-
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 ReportAttention: Patch coverage is
📢 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.
Also this should be named flag_failfast
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: