foundry icon indicating copy to clipboard operation
foundry copied to clipboard

bug(`forge test`): `--rerun` runs passing tests of the same name in different contracts

Open L0GYKAL opened this issue 1 year ago • 1 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [x] Foundry
  • [x] Foundryup

What version of Foundry are you on?

forge Version: 1.2.1-stable

What version of Foundryup are you on?

foundryup: 1.0.1

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

I have tests that have the same name but in different contracts and if one of them doesn't pass, if I want to rerun only the non-passing tests, I use forge test --rerun which should only run the non-passing tests. And it still runs the passing tests that have the same names as the non-passing ones (which are run as well)

L0GYKAL avatar Jun 03 '25 13:06 L0GYKAL

Fixed by #14994: --rerun now persists exact contract/test pairs, so passing tests with the same name in other contracts are no longer re-run. Covered by the rerun_filters_same_named_tests_by_contract regression test.

mattsse avatar Jul 10 '26 00:07 mattsse