Skip to content

Commit 5f25e29

Browse files
authored
Merge pull request #303 from upodroid/fix-cl2
allow repeated --test-overrides & --test-configs to work for cl2
2 parents 6732778 + eead31d commit 5f25e29

File tree

1 file changed

+18
-16
lines changed
  • pkg/testers/clusterloader2

1 file changed

+18
-16
lines changed

pkg/testers/clusterloader2/cl2.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"os"
2323
"path/filepath"
24-
"strings"
2524

2625
"github.com/kballard/go-shellquote"
2726
"github.com/octago/sflags/gen/gpflag"
@@ -35,17 +34,17 @@ import (
3534
var GitTag string
3635

3736
type Tester struct {
38-
Suites string `desc:"Comma separated list of standard scale testing suites e.g. load, density"`
39-
TestOverrides string `desc:"Comma separated list of paths to the config override files. The latter overrides take precedence over changes in former files."`
40-
TestConfigs string `desc:"Comma separated list of paths to test config files."`
41-
Provider string `desc:"The type of cluster provider used (e.g gke, gce, skeleton)"`
42-
KubeConfig string `desc:"Path to kubeconfig. If specified will override the path exposed by the kubetest2 deployer."`
43-
RepoRoot string `desc:"Path to repository root of kubernetes/perf-tests"`
44-
ReportDir string `desc:"Path to directory, where summaries files should be stored. If not specified, summaries are stored in $ARTIFACTS directory"`
45-
Nodes int `desc:"Number of nodes in the cluster. 0 will auto-detect schedulable nodes."`
46-
EnablePrometheusServer bool `desc:"Whether to set-up the prometheus server in the cluster."`
47-
PrometheusPvcStorageClass string `desc:"Storage class used with prometheus persistent volume claim."`
48-
ExtraArgs string `flag:"~extra-args" desc:"Additional arguments supported by clusterloader2 (https://github.com/kubernetes/perf-tests/blob/master/clusterloader2/cmd/clusterloader.go)."`
37+
Suites []string `desc:"List of standard scale testing suites e.g. load, density"`
38+
TestOverrides []string `desc:"List of paths to the config override files. The latter overrides take precedence over changes in former files."`
39+
TestConfigs []string `desc:"List of paths to test config files."`
40+
Provider string `desc:"The type of cluster provider used (e.g gke, gce, skeleton)"`
41+
KubeConfig string `desc:"Path to kubeconfig. If specified will override the path exposed by the kubetest2 deployer."`
42+
RepoRoot string `desc:"Path to repository root of kubernetes/perf-tests"`
43+
ReportDir string `desc:"Path to directory, where summaries files should be stored. If not specified, summaries are stored in $ARTIFACTS directory"`
44+
Nodes int `desc:"Number of nodes in the cluster. 0 will auto-detect schedulable nodes."`
45+
EnablePrometheusServer bool `desc:"Whether to set-up the prometheus server in the cluster."`
46+
PrometheusPvcStorageClass string `desc:"Storage class used with prometheus persistent volume claim."`
47+
ExtraArgs string `flag:"~extra-args" desc:"Additional arguments supported by clusterloader2 (https://github.com/kubernetes/perf-tests/blob/master/clusterloader2/cmd/clusterloader.go)."`
4948
}
5049

5150
func NewDefaultTester() *Tester {
@@ -64,11 +63,14 @@ func (t *Tester) Test() error {
6463
}
6564

6665
var testConfigs, testOverrides []string
67-
testConfigs = append(testConfigs, strings.Split(t.TestConfigs, ",")...)
68-
testOverrides = append(testOverrides, strings.Split(t.TestOverrides, ",")...)
66+
if len(t.TestConfigs) > 0 {
67+
testConfigs = append(testConfigs, t.TestConfigs...)
68+
}
69+
if len(t.TestOverrides) > 0 {
70+
testOverrides = append(testOverrides, t.TestOverrides...)
71+
}
6972

70-
sweets := strings.Split(t.Suites, ",")
71-
for _, sweet := range sweets {
73+
for _, sweet := range t.Suites {
7274
if s := suite.GetSuite(sweet); s != nil {
7375
if len(s.TestConfigs) > 0 {
7476
testConfigs = append(testConfigs, s.TestConfigs...)

0 commit comments

Comments
 (0)