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

Nargo runs all tests with the same name #1836

Closed
phated opened this issue Jun 28, 2023 · 3 comments · Fixed by #2017
Closed

Nargo runs all tests with the same name #1836

phated opened this issue Jun 28, 2023 · 3 comments · Fixed by #2017
Labels
bug Something isn't working

Comments

@phated
Copy link
Contributor

phated commented Jun 28, 2023

Aim

The nargo test command should be able to run exactly one test in a specific file.

Expected Behavior

Currently, if you have multiple test functions with the same name (e.g. in different files in your project), the nargo test <TEST_NAME> command will run all those tests.

Bug

There should be a way to run exactly one test in a specific file, otherwise running nargo test <TEST_NAME> via the LSP might run multiple tests.

To Reproduce

  1. Create a project with 2 files that have tests with the same name
  2. Use > Run Test as provided by feat(lsp): Add a codelens that runs test when clicked #1835
  3. Notice that the output says 2 tests ran:
Screenshot 2023-06-28 at 4 05 47 PM

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@phated phated added the bug Something isn't working label Jun 28, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jun 28, 2023
@kevaundray
Copy link
Contributor

I think we should copy rust testing workflow here and do module scopes in the regex to pinpoint a file.

Leaving the bug label because test names need to be named properly in that case

@kevaundray
Copy link
Contributor

@f01dab1e do you want to take this on?

@ghost
Copy link

ghost commented Jul 23, 2023

I'll take this task

@kevaundray kevaundray assigned ghost Jul 23, 2023
@ghost ghost mentioned this issue Jul 24, 2023
2 tasks
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants