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

Support multiple test names with nargo test #7150

Closed
michaeljklein opened this issue Jan 22, 2025 · 3 comments · Fixed by #7186
Closed

Support multiple test names with nargo test #7150

michaeljklein opened this issue Jan 22, 2025 · 3 comments · Fixed by #7186
Assignees
Labels
enhancement New feature or request

Comments

@michaeljklein
Copy link
Contributor

michaeljklein commented Jan 22, 2025

Problem

Attempted to run a list of tests as with cargo test, i.e.

❯ nargo run test field::tests::test_to_le_radix_257 field::tests::test_to_le_radix_1 field::tests::test_to_le_radix_3

But I got the error:

error: unexpected argument 'field::tests::test_to_le_radix_1' found

Usage: nargo test [OPTIONS] [TEST_NAME]

For more information, try '--help'.

Because only one TEST_NAME is supported.

(Note that in this case, I can filter with the string "field::tests::test_to_le_radix_", but that's not always the case.)

Happy Case

Support multiple filters, i.e. nargo test [OPTIONS] str1 str2 .. -> test_name.contains(str1) || test_name.contains(str2)

Workaround

Yes

Workaround Description

Call nargo multiple times with the different TEST_NAME's

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the enhancement New feature or request label Jan 22, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 22, 2025
@asterite
Copy link
Collaborator

It seems cargo test doesn't support that either. That doesn't mean we shouldn't support it though...

@michaeljklein
Copy link
Contributor Author

michaeljklein commented Jan 23, 2025

It seems cargo test doesn't support that either.

How are you invoking it? I use cargo test -- name1 name2, e.g.

cargo test -- parser::parser::attributes::tests::parses_inner_attribute_as_tag parser::parser::attributes::tests::parses_inner_attribute_as_tag_with_nested_brackets tests::cfg_disabled_attribute_on_function tests::cfg_disabled_attribute_on_function_rejects_parse_error tests::cfg_disabled_attribute_on_global tests::cfg_disabled_attribute_on_module tests::cfg_disabled_attribute_on_use 

@asterite
Copy link
Collaborator

Oh, I was doing cargo test one two. That works with just one test.

@asterite asterite self-assigned this Jan 24, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants