Skip to content

Commit 84203d4

Browse files
authored
remove flags from test packages 1 (#4835)
1 parent 4d8d3e4 commit 84203d4

13 files changed

Lines changed: 13 additions & 201 deletions

File tree

tools/integration_tests/benchmarking/setup_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,7 @@ func TestMain(m *testing.M) {
7979
// 1. Load and parse the common configuration.
8080
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
8181
if len(cfg.Benchmarking) == 0 {
82-
log.Println("No configuration found for benchmarking tests in config. Using flags instead.")
83-
// Populate the config manually.
84-
cfg.Benchmarking = make([]test_suite.TestConfig, 1)
85-
cfg.Benchmarking[0].TestBucket = setup.TestBucket()
86-
cfg.Benchmarking[0].GKEMountedDirectory = setup.MountedDirectory()
87-
cfg.Benchmarking[0].LogFile = setup.LogFile()
88-
// Manually add configs for each benchmark test.
89-
cfg.Benchmarking[0].Configs = make([]test_suite.ConfigItem, 3)
90-
cfg.Benchmarking[0].Configs[0].Flags = []string{"--stat-cache-ttl=0", "--stat-cache-ttl=0 --client-protocol=grpc"}
91-
cfg.Benchmarking[0].Configs[0].Run = "Benchmark_Stat"
92-
cfg.Benchmarking[0].Configs[1].Flags = []string{"--stat-cache-ttl=0 --enable-atomic-rename-object=true", "--stat-cache-ttl=0 --enable-atomic-rename-object=true --client-protocol=grpc"}
93-
cfg.Benchmarking[0].Configs[1].Run = "Benchmark_Rename"
94-
cfg.Benchmarking[0].Configs[2].Flags = []string{"--stat-cache-ttl=0", "--client-protocol=grpc --stat-cache-ttl=0"}
95-
cfg.Benchmarking[0].Configs[2].Run = "Benchmark_Delete"
82+
log.Fatal("No configuration found for Benchmarking in config file.")
9683
}
9784

9885
testEnv.ctx = context.Background()

tools/integration_tests/buffered_read/setup_test.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,7 @@ func TestMain(m *testing.M) {
6464

6565
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
6666
if len(cfg.BufferedRead) == 0 {
67-
log.Println("No configuration found for buffered_read tests in config. Using flags instead.")
68-
cfg.BufferedRead = make([]test_suite.TestConfig, 1)
69-
cfg.BufferedRead[0].TestBucket = setup.TestBucket()
70-
cfg.BufferedRead[0].GKEMountedDirectory = setup.MountedDirectory()
71-
cfg.BufferedRead[0].LogFile = setup.LogFile()
72-
cfg.BufferedRead[0].Configs = make([]test_suite.ConfigItem, 3)
73-
74-
cfg.BufferedRead[0].Configs[0].Flags = []string{
75-
"--enable-buffered-read --read-block-size-mb=8 --read-max-blocks-per-handle=20 --read-start-blocks-per-handle=1 --read-min-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestBufferedReadSuite.log --log-severity=TRACE",
76-
"--client-protocol=grpc --enable-buffered-read --read-block-size-mb=8 --read-max-blocks-per-handle=20 --read-start-blocks-per-handle=1 --read-min-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestBufferedReadSuite.log --log-severity=TRACE",
77-
}
78-
cfg.BufferedRead[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
79-
cfg.BufferedRead[0].Configs[0].Run = "TestSequentialReadSuite"
80-
81-
cfg.BufferedRead[0].Configs[1].Flags = []string{
82-
"--enable-buffered-read --read-block-size-mb=8 --read-min-blocks-per-handle=2 --read-global-max-blocks=1 --read-max-blocks-per-handle=10 --read-start-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestInsufficientPoolCreationSuite.log --log-severity=TRACE",
83-
"--client-protocol=grpc --enable-buffered-read --read-block-size-mb=8 --read-min-blocks-per-handle=2 --read-global-max-blocks=1 --read-max-blocks-per-handle=10 --read-start-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestInsufficientPoolCreationSuite.log --log-severity=TRACE",
84-
}
85-
cfg.BufferedRead[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
86-
cfg.BufferedRead[0].Configs[1].Run = "TestInsufficientPoolCreationSuite"
87-
88-
cfg.BufferedRead[0].Configs[2].Flags = []string{
89-
"--enable-buffered-read --read-block-size-mb=8 --read-max-blocks-per-handle=20 --read-start-blocks-per-handle=2 --read-min-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestRandomReadFallbackSuite.log --log-severity=TRACE",
90-
"--client-protocol=grpc --enable-buffered-read --read-block-size-mb=8 --read-max-blocks-per-handle=20 --read-start-blocks-per-handle=2 --read-min-blocks-per-handle=2 --enable-kernel-reader=false --log-file=/gcsfuse-tmp/TestRandomReadFallbackSuite.log --log-severity=TRACE",
91-
}
92-
cfg.BufferedRead[0].Configs[2].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
93-
cfg.BufferedRead[0].Configs[2].Run = "TestRandomReadFallbackSuite"
67+
log.Fatal("No configuration found for BufferedRead in config file.")
9468
}
9569

9670
testEnv.ctx = context.Background()

tools/integration_tests/dentry_cache/setup_test.go

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,7 @@ func TestMain(m *testing.M) {
6464
// 1. Load and parse the common configuration.
6565
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
6666
if len(cfg.DentryCache) == 0 {
67-
log.Println("No configuration found for dentry_cache tests in config. Using flags instead.")
68-
// Populate the config manually.
69-
cfg.DentryCache = make([]test_suite.TestConfig, 1)
70-
cfg.DentryCache[0].TestBucket = setup.TestBucket()
71-
cfg.DentryCache[0].GKEMountedDirectory = setup.MountedDirectory()
72-
cfg.DentryCache[0].LogFile = setup.LogFile()
73-
cfg.DentryCache[0].Configs = make([]test_suite.ConfigItem, 3)
74-
cfg.DentryCache[0].Configs[0].Flags = []string{
75-
"--implicit-dirs --experimental-enable-dentry-cache --metadata-cache-ttl-secs=2",
76-
}
77-
cfg.DentryCache[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
78-
cfg.DentryCache[0].Configs[0].Run = "TestStatWithDentryCacheEnabledTest"
79-
cfg.DentryCache[0].Configs[1].Flags = []string{
80-
"--implicit-dirs --experimental-enable-dentry-cache --metadata-cache-ttl-secs=1000",
81-
}
82-
cfg.DentryCache[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
83-
cfg.DentryCache[0].Configs[1].Run = "TestDeleteOperationTest"
84-
cfg.DentryCache[0].Configs[2].Flags = []string{
85-
"--implicit-dirs --experimental-enable-dentry-cache --metadata-cache-ttl-secs=1000",
86-
}
87-
cfg.DentryCache[0].Configs[2].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
88-
cfg.DentryCache[0].Configs[2].Run = "TestNotifierTest"
67+
log.Fatal("No configuration found for DentryCache in config file.")
8968
}
9069

9170
testEnv.ctx = context.Background()

tools/integration_tests/explicit_dir/explicit_dir_test.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@ func TestMain(m *testing.M) {
4747
// 1. Load and parse the common configuration.
4848
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
4949
if len(cfg.ExplicitDir) == 0 {
50-
log.Println("No configuration found for explicit_dir tests in config. Using flags instead.")
51-
// Populate the config manually.
52-
cfg.ExplicitDir = make([]test_suite.TestConfig, 1)
53-
cfg.ExplicitDir[0].TestBucket = setup.TestBucket()
54-
cfg.ExplicitDir[0].GKEMountedDirectory = setup.MountedDirectory()
55-
cfg.ExplicitDir[0].Configs = make([]test_suite.ConfigItem, 1)
56-
cfg.ExplicitDir[0].Configs[0].Flags = []string{"--implicit-dirs=false", "--implicit-dirs=false --client-protocol=grpc"}
57-
cfg.ExplicitDir[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": false, "zonal": false}
50+
log.Fatal("No configuration found for ExplicitDir in config file.")
5851
}
5952

6053
// 2. Create storage client before running tests.

tools/integration_tests/gzip/gzip_test.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,7 @@ func TestMain(m *testing.M) {
197197
// 1. Load and parse the common configuration.
198198
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
199199
if len(cfg.Gzip) == 0 {
200-
log.Println("No configuration found for gzip tests in config. Using flags instead.")
201-
// Populate the config manually.
202-
cfg.Gzip = make([]test_suite.TestConfig, 1)
203-
cfg.Gzip[0].TestBucket = setup.TestBucket()
204-
cfg.Gzip[0].GKEMountedDirectory = setup.MountedDirectory()
205-
cfg.Gzip[0].Configs = make([]test_suite.ConfigItem, 1)
206-
cfg.Gzip[0].Configs[0].Flags = []string{
207-
"--sequential-read-size-mb=1 --implicit-dirs",
208-
"--sequential-read-size-mb=1 --implicit-dirs --client-protocol=grpc",
209-
}
210-
cfg.Gzip[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
200+
log.Fatal("No configuration found for Gzip in config file.")
211201
}
212202

213203
// 2. Create storage client before running tests.

tools/integration_tests/implicit_dir/implicit_dir_test.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,7 @@ func TestMain(m *testing.M) {
6666
// 1. Load and parse the common configuration.
6767
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
6868
if len(cfg.ImplicitDir) == 0 {
69-
log.Println("No configuration found for implicit_dir tests in config. Using flags instead.")
70-
// Populate the config manually.
71-
cfg.ImplicitDir = make([]test_suite.TestConfig, 1)
72-
cfg.ImplicitDir[0].TestBucket = setup.TestBucket()
73-
cfg.ImplicitDir[0].GKEMountedDirectory = setup.MountedDirectory()
74-
cfg.ImplicitDir[0].Configs = make([]test_suite.ConfigItem, 2)
75-
cfg.ImplicitDir[0].Configs[0].Flags = []string{"--implicit-dirs"}
76-
cfg.ImplicitDir[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
77-
cfg.ImplicitDir[0].Configs[1].Flags = []string{"--implicit-dirs --client-protocol=grpc"}
78-
cfg.ImplicitDir[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": false}
69+
log.Fatal("No configuration found for ImplicitDir in config file.")
7970
}
8071

8172
// 2. Create storage client before running tests.

tools/integration_tests/inactive_stream_timeout/setup_test.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,7 @@ func TestMain(m *testing.M) {
132132
// 1. read config file
133133
configFile := test_suite.ReadConfigFile(setup.ConfigFile())
134134
if len(configFile.InactiveStreamTimeout) == 0 {
135-
log.Println("No configuration found for inactive_stream_timeout tests in config. Using default flags.")
136-
configFile.InactiveStreamTimeout = make([]test_suite.TestConfig, 1)
137-
testEnv.cfg = &configFile.InactiveStreamTimeout[0]
138-
testEnv.cfg.TestBucket = setup.TestBucket()
139-
testEnv.cfg.LogFile = setup.LogFile()
140-
testEnv.cfg.GKEMountedDirectory = setup.MountedDirectory()
141-
142-
testEnv.cfg.Configs = make([]test_suite.ConfigItem, 2)
143-
testEnv.cfg.Configs[0].Flags = []string{
144-
"--read-inactive-stream-timeout=1s --client-protocol=http1 --log-format=json --log-file=/gcsfuse-tmp/TestTimeoutEnabledSuite.log",
145-
"--read-inactive-stream-timeout=1s --client-protocol=grpc --log-format=json --log-file=/gcsfuse-tmp/TestTimeoutEnabledSuite.log",
146-
}
147-
testEnv.cfg.Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
148-
testEnv.cfg.Configs[0].Run = "TestTimeoutEnabledSuite"
149-
150-
testEnv.cfg.Configs[1].Flags = []string{
151-
"--read-inactive-stream-timeout=0s --client-protocol=http1 --log-format=json --log-file=/gcsfuse-tmp/TestTimeoutDisabledSuite.log",
152-
}
153-
testEnv.cfg.Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
154-
testEnv.cfg.Configs[1].Run = "TestTimeoutDisabledSuite"
135+
log.Fatal("No configuration found for InactiveStreamTimeout in config file.")
155136
}
156137
testEnv.cfg = &configFile.InactiveStreamTimeout[0]
157138
testEnv.ctx = context.Background()

tools/integration_tests/interrupt/interrupt_test.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,7 @@ func TestMain(m *testing.M) {
4747
// 1. Load and parse the common configuration.
4848
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
4949
if len(cfg.Interrupt) == 0 {
50-
log.Println("No configuration found for interrupt tests in config. Using flags instead.")
51-
// Populate the config manually.
52-
cfg.Interrupt = make([]test_suite.TestConfig, 1)
53-
cfg.Interrupt[0].TestBucket = setup.TestBucket()
54-
cfg.Interrupt[0].GKEMountedDirectory = setup.MountedDirectory()
55-
cfg.Interrupt[0].Configs = make([]test_suite.ConfigItem, 2)
56-
cfg.Interrupt[0].Configs[0].Flags = []string{
57-
"--implicit-dirs=true --enable-streaming-writes=false",
58-
"--ignore-interrupts=true --enable-streaming-writes=false",
59-
"--ignore-interrupts=false --enable-streaming-writes=false",
60-
}
61-
cfg.Interrupt[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
62-
cfg.Interrupt[0].Configs[1].Flags = []string{
63-
"--enable-streaming-writes=true",
64-
}
65-
cfg.Interrupt[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": false}
50+
log.Fatal("No configuration found for Interrupt in config file.")
6651
}
6752

6853
// 2. Create storage client before running tests.

tools/integration_tests/list_large_dir/list_large_dir_test.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,7 @@ func TestMain(m *testing.M) {
5757
// 1. Load and parse the common configuration.
5858
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
5959
if len(cfg.ListLargeDir) == 0 {
60-
log.Println("No configuration found for list large dir tests in config. Using flags instead.")
61-
// Populate the config manually.
62-
cfg.ListLargeDir = make([]test_suite.TestConfig, 1)
63-
cfg.ListLargeDir[0].TestBucket = setup.TestBucket()
64-
cfg.ListLargeDir[0].GKEMountedDirectory = setup.MountedDirectory()
65-
cfg.ListLargeDir[0].Configs = make([]test_suite.ConfigItem, 2)
66-
cfg.ListLargeDir[0].Configs[0].Flags = []string{
67-
"--implicit-dirs=true,--stat-cache-ttl=0,--kernel-list-cache-ttl-secs=-1",
68-
"--client-protocol=grpc,--implicit-dirs=true,--stat-cache-ttl=0,--kernel-list-cache-ttl-secs=-1",
69-
}
70-
cfg.ListLargeDir[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
71-
cfg.ListLargeDir[0].Configs[0].Run = "TestListLargeDirWithKernelListCache"
72-
cfg.ListLargeDir[0].Configs[1].Flags = []string{
73-
"--enable-metadata-prefetch --implicit-dirs=true",
74-
"--client-protocol=grpc --enable-metadata-prefetch --implicit-dirs=true",
75-
}
76-
cfg.ListLargeDir[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
77-
cfg.ListLargeDir[0].Configs[1].Run = "TestListLargeDirWithoutKernelListCache"
60+
log.Fatal("No configuration found for ListLargeDir in config file.")
7861
}
7962

8063
// 2. Create storage client before running tests.

tools/integration_tests/local_file/setup_test.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,7 @@ func TestMain(m *testing.M) {
4444
// 1. Load and parse the common configuration.
4545
cfg := test_suite.ReadConfigFile(setup.ConfigFile())
4646
if len(cfg.LocalFile) == 0 {
47-
log.Println("No configuration found for LocalFile tests in config. Using flags instead.")
48-
// Populate the config manually.
49-
cfg.LocalFile = make([]test_suite.TestConfig, 1)
50-
cfg.LocalFile[0].TestBucket = setup.TestBucket()
51-
cfg.LocalFile[0].GKEMountedDirectory = setup.MountedDirectory()
52-
cfg.LocalFile[0].Configs = make([]test_suite.ConfigItem, 2)
53-
cfg.LocalFile[0].Configs[0].Flags = []string{
54-
"--implicit-dirs=true --rename-dir-limit=3 --enable-streaming-writes=false",
55-
"--implicit-dirs=false --rename-dir-limit=3 --enable-streaming-writes=false --client-protocol=grpc",
56-
"--rename-dir-limit=3 --write-block-size-mb=1 --write-max-blocks-per-file=2 --write-global-max-blocks=0",
57-
}
58-
cfg.LocalFile[0].Configs[0].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": true}
59-
cfg.LocalFile[0].Configs[1].Flags = []string{
60-
"--rename-dir-limit=3 --write-block-size-mb=1 --write-max-blocks-per-file=2 --write-global-max-blocks=-1 --client-protocol=grpc",
61-
"--rename-dir-limit=3 --write-block-size-mb=1 --write-max-blocks-per-file=2 --write-global-max-blocks=-1",
62-
}
63-
cfg.LocalFile[0].Configs[1].Compatible = map[string]bool{"flat": true, "hns": true, "zonal": false}
47+
log.Fatal("No configuration found for LocalFile in config file.")
6448
}
6549

6650
// 2. Create storage client before running tests.

0 commit comments

Comments
 (0)