Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix only dir mounting e2e test #1880

Merged
merged 5 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 3 additions & 2 deletions tools/integration_tests/local_file/local_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import (
)

const (
testDirName = "LocalFileTest"
testDirName = "LocalFileTest"
OnlyDirMounted = "OnlyDirMountLocalFiles"
Tulsishah marked this conversation as resolved.
Show resolved Hide resolved
)

var (
Expand Down Expand Up @@ -109,7 +110,7 @@ func TestMain(m *testing.M) {
successCode := static_mounting.RunTests(flagsSet, m)

if successCode == 0 {
successCode = only_dir_mounting.RunTests(flagsSet, m)
successCode = only_dir_mounting.RunTests(flagsSet, OnlyDirMounted, m)
}

if successCode == 0 {
Expand Down
3 changes: 2 additions & 1 deletion tools/integration_tests/operations/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const PrefixFileInDirThreeInCreateThreeLevelDirTest = "fileInDirThreeInCreateThr
const FileInDirThreeInCreateThreeLevelDirTest = "fileInDirThreeInCreateThreeLevelDirTest1"
const ContentInFileInDirThreeInCreateThreeLevelDirTest = "Hello world!!"
const Content = "line 1\nline 2\n"
const OnlyDirMounted = "OnlyDirMountOperations"

func createMountConfigsAndEquivalentFlags() (flags [][]string) {
cacheDirPath := path.Join(os.Getenv("HOME"), "cache-dri")
Expand Down Expand Up @@ -154,7 +155,7 @@ func TestMain(m *testing.M) {
successCode := static_mounting.RunTests(flagsSet, m)

if successCode == 0 {
successCode = only_dir_mounting.RunTests(flagsSet, m)
successCode = only_dir_mounting.RunTests(flagsSet, OnlyDirMounted, m)
}

if successCode == 0 {
Expand Down
2 changes: 1 addition & 1 deletion tools/integration_tests/read_cache/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

const (
testDirName = "ReadCacheTest"
onlyDirMounted = "Test"
onlyDirMounted = "OnlyDirMountReadCache"
cacheSubDirectoryName = "gcsfuse-file-cache"
smallContentSize = 128 * util.KiB
chunkSizeToRead = 128 * util.KiB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const EmptySubDirectory = "emptySubDirectory"
const NonEmptySubDirectory = "nonEmptySubDirectory"
const RenamedDirectory = "renamedDirectory"
const PrefixTempFile = "temp"
const OnlyDirMounted = "OnlyDirMountRenameDirLimit"

func TestMain(m *testing.M) {
setup.ParseSetUpFlags()
Expand All @@ -58,7 +59,7 @@ func TestMain(m *testing.M) {
successCode := static_mounting.RunTests(flags, m)

if successCode == 0 {
successCode = only_dir_mounting.RunTests(flags, m)
successCode = only_dir_mounting.RunTests(flags, OnlyDirMounted, m)
}

if successCode == 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ func mountGcsFuseForFlagsAndExecuteTests(flags [][]string, m *testing.M) (succes
return
}

func executeTestsForOnlyDirMounting(flags [][]string, m *testing.M) (successCode int) {
func executeTestsForOnlyDirMounting(flags [][]string, dirName string, m *testing.M) (successCode int) {
// Set onlyDirMounted value to the directory being mounted.
setup.SetOnlyDirMounted(DirectoryInTestBucket)
mountDirInBucket := path.Join(setup.TestBucket(), DirectoryInTestBucket)
setup.SetOnlyDirMounted(dirName)
mountDirInBucket := path.Join(setup.TestBucket(), dirName)
// Clean the bucket.

setup.RunScriptForTestData("../util/mounting/only_dir_mounting/testdata/delete_objects.sh", mountDirInBucket)
Expand All @@ -84,10 +84,10 @@ func executeTestsForOnlyDirMounting(flags [][]string, m *testing.M) (successCode
return
}

func RunTests(flags [][]string, m *testing.M) (successCode int) {
func RunTests(flags [][]string, dirName string, m *testing.M) (successCode int) {
log.Println("Running only dir mounting tests...")

successCode = executeTestsForOnlyDirMounting(flags, m)
successCode = executeTestsForOnlyDirMounting(flags, dirName, m)

log.Printf("Test log: %s\n", setup.LogFile())

Expand Down
Loading