Skip to content
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(forge): option to replay last test run failures only #8338

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Jul 3, 2024

Motivation

Closes #4000

Solution

  • add new option --rerun in filter args to run only test failures from last run
  • persist filter with failures of last run in file (if any), defaults to cache/test-failures file. File path can be configured in toml test_failures_file = path/to/file and is removed on forge clean
  • cleanup: move --show-progress in test args

@grandizzy grandizzy changed the title feat(forge): option to replay last test run failures feat(forge): option to replay last test run failures only Jul 3, 2024
@grandizzy grandizzy marked this pull request as ready for review July 3, 2024 09:28
/// Re-run recorded test failures from last run.
/// If no failure recorded then regular test run is performed.
#[arg(long)]
pub run_failures: bool,
Copy link
Member

@zerosnacks zerosnacks Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could possibly be shortened to --rerun for brevity as people will likely append it to the command after running their initial test that failed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, can change. Not sure though it would be obvious that only failures are run if renamed to --rerun?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it in 55f68c9 description should be enough to make it clear it reruns only failures 👍

Small change in the way test match is extracted
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! pending others

@grandizzy grandizzy merged commit 278e16c into foundry-rs:master Jul 4, 2024
19 checks passed
@grandizzy grandizzy deleted the issue-4000 branch July 4, 2024 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rerun only failing tests
3 participants