@@ -76,6 +76,8 @@ type conformanceData struct {
76
76
Release string
77
77
// File is the filename where the test is defined. We intentionally don't save the line here to avoid meaningless changes.
78
78
File string
79
+ // Behaviors is the list of conformance behaviors tested by a particular e2e test
80
+ Behaviors []string `yaml:"behaviors,omitempty"`
79
81
}
80
82
81
83
func main () {
@@ -292,23 +294,40 @@ func commentToConformanceData(comment string) *conformanceData {
292
294
lines := strings .Split (comment , "\n " )
293
295
descLines := []string {}
294
296
cd := & conformanceData {}
297
+ var curLine string
295
298
for _ , line := range lines {
296
299
line = strings .TrimSpace (line )
297
300
if len (line ) == 0 {
298
301
continue
299
302
}
300
303
if sline := regexp .MustCompile ("^Testname\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
304
+ curLine = "Testname"
301
305
cd .TestName = sline [1 ]
302
306
continue
303
307
}
304
308
if sline := regexp .MustCompile ("^Release\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
309
+ curLine = "Release"
305
310
cd .Release = sline [1 ]
306
311
continue
307
312
}
308
313
if sline := regexp .MustCompile ("^Description\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
309
- line = sline [1 ]
314
+ curLine = "Description"
315
+ descLines = append (descLines , sline [1 ])
316
+ continue
317
+ }
318
+ if sline := regexp .MustCompile ("^Behaviors\\ s*:\\ s*" ).Split (line , - 1 ); len (sline ) == 2 {
319
+ curLine = "Behaviors"
320
+ continue
321
+ }
322
+
323
+ // Line has no header
324
+ if curLine == "Behaviors" {
325
+ if sline := regexp .MustCompile ("^-\\ s" ).Split (line , - 1 ); len (sline ) == 2 {
326
+ cd .Behaviors = append (cd .Behaviors , sline [1 ])
327
+ }
328
+ } else if curLine == "Description" {
329
+ descLines = append (descLines , line )
310
330
}
311
- descLines = append (descLines , line )
312
331
}
313
332
if cd .Release == "" && cd .TestName == "" {
314
333
return nil
0 commit comments