Skip to content

Commit

Permalink
change disable to skip
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt committed Aug 4, 2020
1 parent a1e89a4 commit 2e5766a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/commander.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ tests:

it should skip:
command: echo hello
disable: true
skip: true
2 changes: 1 addition & 1 deletion pkg/runtime/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (r *Runner) Run(tests []TestCase) <-chan TestResult {

for t := range tests {
// If test is disabled skip it
if t.Disable {
if t.Skip {
tr := TestResult{TestCase: t, Skipped: true}
out <- tr
continue
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type TestCase struct {
Result CommandResult
Nodes []string
FileName string
Disable bool
Skip bool
}

//GlobalTestConfig represents the configuration for a test
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Test_RuntimeWithRetriesAndInterval(t *testing.T) {

func Test_RuntimeWithSkip(t *testing.T) {
s := getExampleTestCases()
s[0].Disable = true
s[0].Skip = true

r := getRuntime()
got := r.Start(s)
Expand Down
6 changes: 3 additions & 3 deletions pkg/suite/yaml_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type YAMLTest struct {
Stdout interface{} `yaml:"stdout,omitempty"`
Stderr interface{} `yaml:"stderr,omitempty"`
Config YAMLTestConfigConf `yaml:"config,omitempty"`
Disable bool `yaml:"disable,omitempty"`
Skip bool `yaml:"skip,omitempty"`
}

// ParseYAML parses the Suite from a yaml byte slice
Expand Down Expand Up @@ -119,7 +119,7 @@ func convertYAMLSuiteConfToTestCases(conf YAMLSuiteConf, fileName string) []runt
},
Nodes: t.Config.Nodes,
FileName: fileName,
Disable: t.Disable,
Skip: t.Skip,
})
}

Expand Down Expand Up @@ -154,7 +154,7 @@ func (y *YAMLSuiteConf) UnmarshalYAML(unmarshal func(interface{}) error) error {
Stdout: y.convertToExpectedOut(v.Stdout),
Stderr: y.convertToExpectedOut(v.Stderr),
Config: y.mergeConfigs(v.Config, params.Config),
Disable: v.Disable,
Skip: v.Skip,
}

// Set key as command, if command property was empty
Expand Down
4 changes: 2 additions & 2 deletions pkg/suite/yaml_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tests:
exit-code: 0
stdout: hello
stderr: anything
disable: true
skip: true
`)
got := ParseYAML(yaml, "")
tests := got.GetTests()
Expand All @@ -93,7 +93,7 @@ tests:
assert.Equal(t, "it should print hello", tests[0].Title)
assert.Equal(t, "hello", tests[0].Expected.Stdout.Contains[0])
assert.Equal(t, "anything", tests[0].Expected.Stderr.Contains[0])
assert.True(t, tests[0].Disable)
assert.True(t, tests[0].Skip)
}

func TestYAMLConfig_UnmarshalYAML_ShouldConvertStdoutToExpectedOut(t *testing.T) {
Expand Down

0 comments on commit 2e5766a

Please sign in to comment.