Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ ARCH ?= amd64
OSVERSION ?= 1809
# Output type of docker buildx build
OUTPUT_TYPE ?= registry
# Set -short to skip cloud provider tests
UNIT_TEST_ARGS ?=

.EXPORT_ALL_VARIABLES:

Expand All @@ -76,7 +78,7 @@ verify: unit-test

.PHONY: unit-test
unit-test:
go test -v -race ./pkg/... ./test/utils/credentials -timeout=30m
go test -v -race $(UNIT_TEST_ARGS) ./pkg/... ./test/utils/credentials -timeout=30m

.PHONY: sanity-test
sanity-test: azurefile
Expand Down
12 changes: 12 additions & 0 deletions pkg/azurefile/azurefile_dataplane_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import (
)

func TestCreateFileShare(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
testCases := []struct {
name string
testFunc func(t *testing.T)
Expand Down Expand Up @@ -64,6 +67,9 @@ func TestNewAzureFileClient(t *testing.T) {
}

func TestDeleteFileShare(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
testCases := []struct {
name string
testFunc func(t *testing.T)
Expand All @@ -90,6 +96,9 @@ func TestDeleteFileShare(t *testing.T) {
}

func TestResizeFileShare(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
testCases := []struct {
name string
testFunc func(t *testing.T)
Expand All @@ -116,6 +125,9 @@ func TestResizeFileShare(t *testing.T) {
}

func TestGetFileShareQuotaDataPlane(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
testCases := []struct {
name string
testFunc func(t *testing.T)
Expand Down
3 changes: 3 additions & 0 deletions pkg/azurefile/azurefile_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
)

func TestAzurefile(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, "Azurefile Suite")
}
3 changes: 3 additions & 0 deletions pkg/azurefile/azurefile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,9 @@ func TestIsSupportedPublicNetworkAccess(t *testing.T) {
}

func TestCreateFolderIfNotExists(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
d := NewFakeDriver()
ctx := context.Background()

Expand Down
2 changes: 2 additions & 0 deletions pkg/azurefile/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,12 @@ func TestChmodIfPermissionMismatch(t *testing.T) {
skipIfTestingOnWindows(t)
permissionMatchingPath, _ := getWorkDirPath("permissionMatchingPath")
_ = makeDir(permissionMatchingPath, 0755)
_ = os.Chmod(permissionMatchingPath, 0755&^os.ModeSetgid) // clear setgid bit
defer os.RemoveAll(permissionMatchingPath)

permissionMismatchPath, _ := getWorkDirPath("permissionMismatchPath")
_ = makeDir(permissionMismatchPath, 0721)
_ = os.Chmod(permissionMismatchPath, 0721&^os.ModeSetgid) // clear setgid bit
defer os.RemoveAll(permissionMismatchPath)

permissionMatchGidMismatchPath, _ := getWorkDirPath("permissionMatchGidMismatchPath")
Expand Down
Loading