Skip to content

Commit 2ae75e2

Browse files
allows difftest tests to be skipped if they fail, not pass (#14915) (#24097)
[upstream:87b4ef0a14e7b29a18b81105f3ccd7e2d894a278] Signed-off-by: Modular Magician <[email protected]>
1 parent ce409e2 commit 2ae75e2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changelog/14915.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
weekly difftests will skip when failing rather than passing (default behavior is passing in teamcity)
3+
```

scripts/teamcitytestscripts/teamcity.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const (
3636
)
3737

3838
var (
39-
end = regexp.MustCompile(`--- (PASS|SKIP|FAIL):\s+([a-zA-Z_]\S*) \(([\.\d]+)\)`)
39+
// Looks for the final status line, accommodating both simple and full summaries.
40+
end = regexp.MustCompile(`\n(PASS|SKIP|FAIL)(?:[\t\s]+(.*)\s+([0-9\.]+[a-z]+))?\s*$`)
4041
diff = regexp.MustCompile(`\[Diff\] (.*)`)
4142
paniced = regexp.MustCompile(`panic:\s+(.*)\s+\[recovered\]\n`)
4243
//suite = regexp.MustCompile("^(ok|FAIL)\\s+([^\\s]+)\\s+([\\.\\d]+)s")
@@ -100,7 +101,8 @@ func (test *TeamCityTest) FormatTestOutput() string {
100101
}
101102

102103
if test.Fail {
103-
output.WriteString(fmt.Sprintf(TeamCityTestFailed, now, test.Name))
104+
// skip failures for diff tests
105+
output.WriteString(fmt.Sprintf(TeamCityTestIgnored, now, test.Name))
104106
output.WriteString(fmt.Sprintf(TeamCityTestFinished, now, test.Name))
105107
return output.String()
106108
}
@@ -121,8 +123,8 @@ func (test *TeamCityTest) FormatTestOutput() string {
121123
return output.String()
122124
}
123125

124-
// test passes if no diff, even if failure (failure artifacts will be in regular_failure_file.log)
125-
output.WriteString(fmt.Sprintf(TeamCityTestFinished, now, test.Name))
126+
// instead of failing when something unexpected happens, we skip the test now
127+
output.WriteString(fmt.Sprintf(TeamCityTestIgnored, now, test.Name))
126128

127129
return output.String()
128130
}

0 commit comments

Comments
 (0)