@@ -23,6 +23,7 @@ type YAMLTestConfig struct {
2323 Timeout string `yaml:"timeout,omitempty"`
2424 Retries int `yaml:"retries,omitempty"`
2525 Interval string `yaml:"interval,omitempty"`
26+ Nodes []string `yaml:"nodes,omitempty"`
2627}
2728
2829type NodeConf struct {
@@ -55,7 +56,6 @@ type YAMLTest struct {
5556 Stdout interface {} `yaml:"stdout,omitempty"`
5657 Stderr interface {} `yaml:"stderr,omitempty"`
5758 Config YAMLTestConfig `yaml:"config,omitempty"`
58- Nodes []string `yaml:"nodes,omitempty"`
5959}
6060
6161// ParseYAML parses the Suite from a yaml byte slice
@@ -76,6 +76,7 @@ func ParseYAML(content []byte) Suite {
7676 Timeout : yamlConfig .Config .Timeout ,
7777 Retries : yamlConfig .Config .Retries ,
7878 Interval : yamlConfig .Config .Interval ,
79+ Nodes : yamlConfig .Config .Nodes ,
7980 },
8081 Nodes : convertNodes (yamlConfig .Nodes ),
8182 }
@@ -117,7 +118,7 @@ func convertYAMLConfToTestCases(conf YAMLConfig) []runtime.TestCase {
117118 Stdout : t .Stdout .(runtime.ExpectedOut ),
118119 Stderr : t .Stderr .(runtime.ExpectedOut ),
119120 },
120- Nodes : t .Nodes ,
121+ Nodes : t .Config . Nodes ,
121122 })
122123 }
123124
@@ -152,7 +153,6 @@ func (y *YAMLConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
152153 Stdout : y .convertToExpectedOut (v .Stdout ),
153154 Stderr : y .convertToExpectedOut (v .Stderr ),
154155 Config : y .mergeConfigs (v .Config , params .Config ),
155- Nodes : v .Nodes ,
156156 }
157157
158158 // Set key as command, if command property was empty
@@ -185,6 +185,7 @@ func (y *YAMLConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
185185 Timeout : params .Config .Timeout ,
186186 Retries : params .Config .Retries ,
187187 Interval : params .Config .Interval ,
188+ Nodes : params .Config .Nodes ,
188189 }
189190
190191 return nil
@@ -299,6 +300,10 @@ func (y *YAMLConfig) mergeConfigs(local YAMLTestConfig, global YAMLTestConfig) Y
299300 conf .InheritEnv = local .InheritEnv
300301 }
301302
303+ if len (local .Nodes ) != 0 {
304+ conf .Nodes = local .Nodes
305+ }
306+
302307 return conf
303308}
304309
0 commit comments