-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gno test): implement failfast flag #3866
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be helpful for gno-base project CI pipeline. LGTM 👍
remove: review/triage-pending
flag
if cfg.failfast { | ||
io.ErrPrintfln("FAIL") | ||
return fmt.Errorf("FAIL: %d build errors, %d test errors", buildErrCount, testErrCount) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-failfast
does not fail just on the first failing package, but on the first failing test, so this implementation is incomplete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, good catch :)
fixed here I think 2be439e
if opts.FailfastFlag { | ||
return errs | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, needs another round...
This won't stop execution for a subtest, ie. if I run a test using t.Run
inside a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of 79fa228 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this should be named flag_failfast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here 747e41c
@@ -246,6 +255,10 @@ func execTest(cfg *testCfg, args []string, io commands.IO) error { | |||
io.ErrPrintfln("FAIL %s \t%s", pkg.Dir, dstr) | |||
io.ErrPrintfln("FAIL") | |||
testErrCount++ | |||
if cfg.failfast { | |||
io.ErrPrintfln("FAIL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is already a printed FAIL
two lines ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks a lot for your review :)
I think there was some mix with the files diffs but I'm doing the same behavior that on lines
https://github.com/gnolang/gno/pull/3866/files#diff-2e39c5441249018f694183a5710aa7adcad09ec17e870507d20a42184b07e1a7R278-R281
Co-authored-by: Manfred Touron <[email protected]>
Co-authored-by: Manfred Touron <[email protected]>
747e41c
to
50da6e8
Compare
Sorry rebased because they were several files not belonging to this PR |
Overview
This PR introduces support for the -failfast flag in gno test. When enabled, test execution stops as soon as any test fails. However, tests that were already running in parallel will be allowed to complete.
Motivation
In large-scale test executions, test failures can get lost in a flood of output, making it difficult to identify the faulty test. By using -failfast, we can quickly pinpoint failing tests and iterate faster, improving debugging efficiency.
Changes
Implemented -failfast behavior in test execution.
Sources
From Go 1.10 documentation: