mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #70626 from brahmaroutu/conformamce_fix_releasetag
Add Release information to each of the conformance tests.
This commit is contained in:
commit
089e5a750c
@ -72,6 +72,8 @@ type conformanceData struct {
|
|||||||
TestName string
|
TestName string
|
||||||
// Extracted from the "Description:" comment before the test
|
// Extracted from the "Description:" comment before the test
|
||||||
Description string
|
Description string
|
||||||
|
// Version when this test is added or modified ex: v1.12, v1.13
|
||||||
|
Release string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
|
func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
|
||||||
@ -85,13 +87,16 @@ func (v *visitor) convertToConformanceData(at *ast.BasicLit) {
|
|||||||
cd.Description = ""
|
cd.Description = ""
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
line = strings.TrimSpace(line)
|
line = strings.TrimSpace(line)
|
||||||
if strings.HasPrefix(line, "Testname:") {
|
if sline := regexp.MustCompile("^Testname\\s*:\\s*").Split(line, -1); len(sline) == 2 {
|
||||||
line = strings.TrimSpace(line[9:])
|
cd.TestName = sline[1]
|
||||||
cd.TestName = line
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(line, "Description:") {
|
if sline := regexp.MustCompile("^Release\\s*:\\s*").Split(line, -1); len(sline) == 2 {
|
||||||
line = strings.TrimSpace(line[12:])
|
cd.Release = sline[1]
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if sline := regexp.MustCompile("^Description\\s*:\\s*").Split(line, -1); len(sline) == 2 {
|
||||||
|
line = sline[1]
|
||||||
}
|
}
|
||||||
cd.Description += line + "\n"
|
cd.Description += line + "\n"
|
||||||
}
|
}
|
||||||
@ -341,6 +346,7 @@ func main() {
|
|||||||
tests := scanfile(path, nil)
|
tests := scanfile(path, nil)
|
||||||
for _, cd := range tests {
|
for _, cd := range tests {
|
||||||
fmt.Printf("## [%s](%s)\n\n", cd.TestName, cd.URL)
|
fmt.Printf("## [%s](%s)\n\n", cd.TestName, cd.URL)
|
||||||
|
fmt.Printf("### Release %s\n", cd.Release)
|
||||||
fmt.Printf("%s\n\n", cd.Description)
|
fmt.Printf("%s\n\n", cd.Description)
|
||||||
if len(cd.Description) < 10 {
|
if len(cd.Description) < 10 {
|
||||||
missingComments++
|
missingComments++
|
||||||
|
Loading…
Reference in New Issue
Block a user