Repository navigation
Conversation
With -failfast, go test stops a package at its first failing test, and the selected tests after it have no events in the report. The helper passed them, so one failure showed as a single red check among green ones that never ran. A test the binary left out of a failing package passed the same way. Such a test now fails, saying go test failed its package without running it, as a selected test absent from a passing package already does. One failure under -failfast now shows as one red check for the failing test and one for each selected test it stopped. Signed-off-by: Erik Sipsma <[email protected]>
With nothing selected out, a module's test command ran ./..., so it also ran the module's packages that hold no selected test. When one of them failed, such as a package of test helpers that fails to build or whose TestMain fails, every selected test in the module failed with it, however unrelated. The command now names only the packages that hold selected tests, as a partial selection already did. A failing package without any is not run and fails no check. The helper's report of failures in packages without selected test checks can no longer happen and is gone. The packages come in discovery's byte order, so the command is stable without the sort a partial selection did on every check. Signed-off-by: Erik Sipsma <[email protected]>
…t run With -failfast, go test starts no further test binary once a package fails: a package that has not started yet returns without output, so the report has no event for it at all. Its selected tests failed as "no successful result", and which packages that hit depended on whether each had started before the failure. They now fail as "did not run", saying go test stopped before starting their package after a failure. selected-failfast-check no longer selects the second package of the failing module, whose result depended on that timing, so its totals are the same on every run. Signed-off-by: Erik Sipsma <[email protected]>
Contributor
Author
|
Folded into #95, which now carries this PR's commits unchanged alongside the rest of the per-package build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes to how the per-test Go checks report results.
Tests that
-failfaststopped now fail as "did not run"With
-failfastingoflags,go teststops a package at its first failing test, and the selected tests after it get no result. Their checks used to pass, so one failure looked like a single red check among green ones that never ran. They now fail.For example, with
TestFoofailing beforeTestBarinm1/p1,dagger checkshows:Before, the result was 1 failed and 7 passed, with
TestBargreen. One failure under-failfastnow shows as one red check for the failing test and one for each selected test it stopped. The same applies to a selected test that is missing from a failing package's test binary.Only packages that hold selected tests run
When nothing was selected out of a module, its test command ran
./.... That also ran the module's packages that hold no selected test. If one of them failed, every selected test in the module failed with it, for example a package of test helpers that fails to build or whoseTestMainfails. The command now names only the packages that hold selected tests, as a partial selection already did.For a module with tests in
okandhidden, plus a packagebrokenthat fails to compile or fails inTestMain: before, both checks failed with "failures in packages without selected test checks: example.com/reporting/broken". Now both pass. A failing package without selected tests is not run and is reported nowhere.Two cases are unchanged. A package with selected tests still fails them when it fails to build. So does a selected package whose imported package is broken. The report helper's handling of failures in packages without selected tests is unreachable now, and is removed.
Performance
The test command does less work: packages without selected tests are no longer built or run. Their package list is in discovery's byte order, so narrowed runs also stop sorting it on every check. Nothing was measured.
Testing
selected-failfast-check.selected-unchecked-build-checkandselected-unchecked-teardown-checknow expect both tests to pass.dagger check, onlygo-sdk/generate/stalefails. It flagsgobuild/dagger.gen.go, which this PR doesn't touch, and main fails it the same way.