@@ -15,10 +15,11 @@ type YAMLConfig struct {
1515
1616// YAMLTestConfig is a struct to represent the test config
1717type YAMLTestConfig struct {
18- Env map [string ]string `yaml:"env,omitempty"`
19- Dir string `yaml:"dir,omitempty"`
20- Timeout string `yaml:"timeout,omitempty"`
21- Retries int `yaml:"retries,omitempty"`
18+ Env map [string ]string `yaml:"env,omitempty"`
19+ Dir string `yaml:"dir,omitempty"`
20+ Timeout string `yaml:"timeout,omitempty"`
21+ Retries int `yaml:"retries,omitempty"`
22+ Interval string `yaml:"interval,omitempty"`
2223}
2324
2425// YAMLTest represents a test in the yaml test suite
@@ -69,10 +70,11 @@ func ParseYAML(content []byte) Suite {
6970 return YAMLSuite {
7071 TestCases : convertYAMLConfToTestCases (yamlConfig ),
7172 Config : runtime.TestConfig {
72- Env : yamlConfig .Config .Env ,
73- Dir : yamlConfig .Config .Dir ,
74- Timeout : yamlConfig .Config .Timeout ,
75- Retries : yamlConfig .Config .Retries ,
73+ Env : yamlConfig .Config .Env ,
74+ Dir : yamlConfig .Config .Dir ,
75+ Timeout : yamlConfig .Config .Timeout ,
76+ Retries : yamlConfig .Config .Retries ,
77+ Interval : yamlConfig .Config .Interval ,
7678 },
7779 }
7880}
@@ -84,11 +86,12 @@ func convertYAMLConfToTestCases(conf YAMLConfig) []runtime.TestCase {
8486 tests = append (tests , runtime.TestCase {
8587 Title : t .Title ,
8688 Command : runtime.CommandUnderTest {
87- Cmd : t .Command ,
88- Env : t .Config .Env ,
89- Dir : t .Config .Dir ,
90- Timeout : t .Config .Timeout ,
91- Retries : t .Config .Retries ,
89+ Cmd : t .Command ,
90+ Env : t .Config .Env ,
91+ Dir : t .Config .Dir ,
92+ Timeout : t .Config .Timeout ,
93+ Retries : t .Config .Retries ,
94+ Interval : t .Config .Interval ,
9295 },
9396 Expected : runtime.Expected {
9497 ExitCode : t .ExitCode ,
@@ -140,10 +143,11 @@ func (y *YAMLConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
140143
141144 //Parse global configuration
142145 y .Config = YAMLTestConfig {
143- Env : params .Config .Env ,
144- Dir : params .Config .Dir ,
145- Timeout : params .Config .Timeout ,
146- Retries : params .Config .Retries ,
146+ Env : params .Config .Env ,
147+ Dir : params .Config .Dir ,
148+ Timeout : params .Config .Timeout ,
149+ Retries : params .Config .Retries ,
150+ Interval : params .Config .Interval ,
147151 }
148152
149153 return nil
@@ -239,6 +243,10 @@ func (y *YAMLConfig) mergeConfigs(local YAMLTestConfig, global YAMLTestConfig) Y
239243 conf .Retries = local .Retries
240244 }
241245
246+ if local .Interval != "" {
247+ conf .Interval = local .Interval
248+ }
249+
242250 return conf
243251}
244252
0 commit comments