Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Ignore reboot skips, SetUpTest and TearDownTest on the subunit report of integration tests. #70
Conversation
elopio
added some commits
Nov 10, 2015
|
go also announces the start and end of SetUpTest and TearDownTest. I think we should also ignore them, but I'll do that tomorrow. |
elopio
added some commits
Nov 10, 2015
elopio
changed the title from
Ignore reboot skips on the subunit report of integration tests.
to
Ignore reboot skips, SetUpTest and TearDownTest on the subunit report of integration tests.
Nov 10, 2015
niemeyer
reviewed
Nov 10, 2015
| + } else if matches := skipRegexp.FindStringSubmatch(sdata); len(matches) == 3 { | ||
| + reason := matches[2] | ||
| + // Do not report anything about the set ups skipped because of another test's reboot. | ||
| + duringReboot, _ := regexp.MatchString( |
niemeyer
Nov 10, 2015
Contributor
As a rule of thumb, errors should never be ignored. When they are, there should be a comment above the line explaining why it's being ignored. If it's hard to justify, don't ignore it. If it's boring to explain, don't ignore it either, as it's easier to check than to explain.
In this case, for example, a broken regular expression will look silently and exactly the same as an expression that did not match. If you're sure the expression always matches, then create a local helper function such as:
func matchString(pattern string, s string) bool {
matched, err := regexp.MatchString(pattern, s)
if err != nil {
panic(err)
}
return matched
}
Same applies to all such cases below.
|
The logic in this branch is going over my head since I'm not aware of the inner working of subunit, so besides the one issue I could detect it above, I'd suggest picking another review from someone that understand your package. LGTM with that. |
elopio
added some commits
Nov 11, 2015
|
Thanks for the reviews. |
|
Ok, |
elopio commentedNov 10, 2015
When a test requests a reboot, all the remaining tests to run check on their set up if a reboot was requested and skip themselves. Also after the reboot, all the tests that already ran do the same check and skip themselves.
This skips must be ignored on the subunit report of the executed tests.