Skip to content

Commit 089e5a7

Browse files
authored
Merge pull request kubernetes#70626 from brahmaroutu/conformamce_fix_releasetag
Add Release information to each of the conformance tests.
2 parents 11611ee + 37e7000 commit 089e5a7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/conformance/walk.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ type conformanceData struct {
7272
TestName string
7373
// Extracted from the "Description:" comment before the test
7474
Description string
75+
// Version when this test is added or modified ex: v1.12, v1.13
76+
Release string
7577
}
7678

7779
func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
@@ -85,13 +87,16 @@ func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
8587
cd.Description = ""
8688
for _, line := range lines {
8789
line = strings.TrimSpace(line)
88-
if strings.HasPrefix(line, "Testname:") {
89-
line = strings.TrimSpace(line[9:])
90-
cd.TestName = line
90+
if sline := regexp.MustCompile("^Testname\\s*:\\s*").Split(line, -1); len(sline) == 2 {
91+
cd.TestName = sline[1]
9192
continue
9293
}
93-
if strings.HasPrefix(line, "Description:") {
94-
line = strings.TrimSpace(line[12:])
94+
if sline := regexp.MustCompile("^Release\\s*:\\s*").Split(line, -1); len(sline) == 2 {
95+
cd.Release = sline[1]
96+
continue
97+
}
98+
if sline := regexp.MustCompile("^Description\\s*:\\s*").Split(line, -1); len(sline) == 2 {
99+
line = sline[1]
95100
}
96101
cd.Description += line + "\n"
97102
}
@@ -341,6 +346,7 @@ func main() {
341346
tests := scanfile(path, nil)
342347
for _, cd := range tests {
343348
fmt.Printf("## [%s](%s)\n\n", cd.TestName, cd.URL)
349+
fmt.Printf("### Release %s\n", cd.Release)
344350
fmt.Printf("%s\n\n", cd.Description)
345351
if len(cd.Description) < 10 {
346352
missingComments++

0 commit comments

Comments
 (0)