Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tulsishah committed Jun 13, 2024
1 parent a098f8a commit 38a8110
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 41 deletions.
7 changes: 0 additions & 7 deletions tools/integration_tests/list_large_dir/list_large_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ const NumberOfExplicitDirsInDirectoryWithTwelveThousandFiles = 100
func TestMain(m *testing.M) {
setup.ParseSetUpFlags()

if setup.TestOnTPCEndPoint() {
// These tests require the creation of 12,000 objects on a bucket using gcloud,
// which is failing due to a "database locked" error.
log.Print("These tests will not run for TPC endpoint.")
return
}

flags := [][]string{{"--implicit-dirs", "--stat-cache-ttl=0"}}
if !testing.Short() {
flags = append(flags, []string{"--client-protocol=grpc", "--implicit-dirs=true", "--stat-cache-ttl=0"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ func TestMain(m *testing.M) {
return
}

// These tests require changing service account permissions using a gcloud command,
// which is currently not supported on TPC.
if setup.TestOnTPCEndPoint() {
log.Print("These tests will not run for TPC endpoint.")
return
}

// Else run tests for testBucket.
// Set up test directory.
setup.SetUpTestDirForTestBucketFlag()
Expand Down
9 changes: 6 additions & 3 deletions tools/integration_tests/operations/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ func TestMain(m *testing.M) {
mountConfigFlags := createMountConfigsAndEquivalentFlags()
flagsSet = append(flagsSet, mountConfigFlags...)

if setup.TestOnTPCEndPoint() {
successCodeTPC := static_mounting.RunTests(flagsSet, m)
os.Exit(successCodeTPC)
}

successCode := static_mounting.RunTests(flagsSet, m)

if successCode == 0 {
Expand All @@ -192,9 +197,7 @@ func TestMain(m *testing.M) {
successCode = dynamic_mounting.RunTests(ctx, storageClient, flagsSet, m)
}

// These tests require changing service account permissions using a gcloud command,
// which is currently not supported on TPC.
if successCode == 0 && !setup.TestOnTPCEndPoint() {
if successCode == 0 {
successCode = creds_tests.RunTestsForKeyFileAndGoogleApplicationCredentialsEnvVarSet(flagsSet, "objectAdmin", m)
}

Expand Down
4 changes: 1 addition & 3 deletions tools/integration_tests/readonly/readonly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ func TestMain(m *testing.M) {
successCode = persistent_mounting.RunTests(flags, m)
}

// These tests require changing service account permissions using a gcloud command,
// which is currently not supported on TPC.
if successCode == 0 && !setup.TestOnTPCEndPoint() {
if successCode == 0 {
// Test for viewer permission on test bucket.
successCode = creds_tests.RunTestsForKeyFileAndGoogleApplicationCredentialsEnvVarSet(flags, "objectViewer", m)
}
Expand Down
7 changes: 0 additions & 7 deletions tools/integration_tests/readonly_creds/readonly_creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ func TestMain(m *testing.M) {
return
}

// These tests require changing service account permissions using a gcloud command,
// which is currently not supported on TPC.
if setup.TestOnTPCEndPoint() {
log.Print("These tests will not run for TPC endpoint.")
return
}

// Create test directory.
ctx := context.Background()
var storageClient *storage.Client
Expand Down
2 changes: 1 addition & 1 deletion tools/integration_tests/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function main(){
# Clean bucket before testing.
gcloud storage rm -r gs://gcsfuse-e2e-tests-tpc/**

GODEBUG=asyncpreemptoff=1 go test ./tools/integration_tests/... --testOnTPCEndPoint=$RUN_TEST_ON_TPC_ENDPOINT $GO_TEST_SHORT_FLAG -p 1 --integrationTest -v --testbucket=gcsfuse-e2e-tests-tpc --testInstalledPackage=$RUN_E2E_TESTS_ON_PACKAGE -timeout $INTEGRATION_TEST_TIMEOUT
GODEBUG=asyncpreemptoff=1 go test ./tools/integration_tests/operations/... --testOnTPCEndPoint=$RUN_TEST_ON_TPC_ENDPOINT $GO_TEST_SHORT_FLAG -p 1 --integrationTest -v --testbucket=gcsfuse-e2e-tests-tpc --testInstalledPackage=$RUN_E2E_TESTS_ON_PACKAGE -timeout $INTEGRATION_TEST_TIMEOUT
exit_code=$?

set -e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ import (
const DirectoryInTestBucket = "Test"

func MountGcsfuseWithOnlyDir(flags []string) (err error) {
var defaultArg []string
if setup.TestOnTPCEndPoint() {
defaultArg = append(defaultArg, "--custom-endpoint=storage.apis-tpczero.goog:443",
"--key-file=/tmp/sa.key.json")
}

defaultArg = append(defaultArg, "--only-dir",
defaultArg := []string{"--only-dir",
setup.OnlyDirMounted(),
"--debug_gcs",
"--debug_fs",
"--debug_fuse",
"--log-file="+setup.LogFile(),
"--log-file=" + setup.LogFile(),
"--log-format=text",
setup.TestBucket(),
setup.MntDir())
setup.MntDir()}

for i := 0; i < len(defaultArg); i++ {
flags = append(flags, defaultArg[i])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func makePersistentMountingArgs(flags []string) (args []string, err error) {
}

func mountGcsfuseWithPersistentMounting(flags []string) (err error) {
var defaultArg []string
defaultArg = append(defaultArg, setup.TestBucket(),
defaultArg := []string{setup.TestBucket(),
setup.MntDir(),
"-o",
"debug_gcs",
Expand All @@ -50,9 +49,10 @@ func mountGcsfuseWithPersistentMounting(flags []string) (err error) {
"-o",
"debug_fuse",
"-o",
"log_file="+setup.LogFile(),
"log_file=" + setup.LogFile(),
"-o",
"log_format=text")
"log_format=text",
}

if setup.TestOnTPCEndPoint() {
defaultArg = append(defaultArg, "-o", "custom_endpoint=storage.apis-tpczero.goog:443",
Expand Down

0 comments on commit 38a8110

Please sign in to comment.