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

--match-path does not work with watch mode: cannot be used multiple times #8664

Closed
2 tasks done
mds1 opened this issue Aug 14, 2024 · 4 comments
Closed
2 tasks done
Assignees
Labels
Cmd-forge-test Command: forge test good first issue Good for newcomers T-bug Type: bug
Milestone

Comments

@mds1
Copy link
Collaborator

mds1 commented Aug 14, 2024

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (224fe9c 2024-08-14T00:19:31.970378000Z)

What command(s) is the bug in?

forge test --match-path

Operating System

None

Describe the bug

Steps to reproduce:

  1. forge init a new project
  2. Run forge test --match-path test/Counter.t.sol -w
  3. Make some change to the file and you'll get the below error
error: the argument '--match-path <GLOB>' cannot be used multiple times

Usage: forge test [OPTIONS]

For more information, try '--help'.
[Command exited with 2, lasted 10.7375ms]
@mds1 mds1 added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Aug 14, 2024
@zerosnacks zerosnacks added Cmd-forge-test Command: forge test good first issue Good for newcomers and removed T-needs-triage Type: this issue needs to be labelled labels Aug 16, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Aug 16, 2024
@PabloVillaplana
Copy link
Contributor

hey @zerosnacks Can I help with this one? ☝️

@zerosnacks
Copy link
Member

@PabloVillaplana sure! Assigning this to you, thanks!

@PabloVillaplana
Copy link
Contributor

Hey @zerosnacks

Currently when running the command:

forge test --match-path test/Counter.t.sol --watch

It is not necessary to add the ---match-path because by default the --watch is added by code, now what I did was add a validation that if it already has it in the arguments, do not add it to avoid redundancy and errors like the reported issue

Could you help me to check the PR to see if everything is fine ?

klkvr added a commit that referenced this issue Aug 21, 2024
…ot be used multiple times #8664 (#8709)

* Issue #8664 | Bug 🐛: --match-path does not work with watch mode: cannot be used multiple times #8664

* reuse _no_reconfigure var

* Remove undescore var name and also remove no needed extra lines

* fmt

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
@zerosnacks
Copy link
Member

Thanks @PabloVillaplana LGTM, marking ticket as resolved

benwjhack pushed a commit to CompassLabs/foundry-test that referenced this issue Sep 11, 2024
…mode: cannot be used multiple times foundry-rs#8664 (foundry-rs#8709)

* Issue foundry-rs#8664 | Bug 🐛: --match-path does not work with watch mode: cannot be used multiple times foundry-rs#8664

* reuse _no_reconfigure var

* Remove undescore var name and also remove no needed extra lines

* fmt

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmd-forge-test Command: forge test good first issue Good for newcomers T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants