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

Enable test query for exact test name #1900

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

BCSharp
Copy link
Member

@BCSharp BCSharp commented Feb 1, 2025

The standard way of running a specific test is by using a query. E.g. to test test_codecs

./make.ps1 test-test_codecs

However, this matches tests by substring, so for more popular test names the query may catch several tests. The example above selects the following tests for running:

  • CPython.test_codecs (currently ignored)
  • IronPython.modules.io_related.test_codecs
  • IronPython.test_codecs
  • Ironpython.test_codecs_stdlib

Even running more specific

./make.ps1 test-IronPython.test_codecs

will still match two tests.

To be able to run just one selected test, one must resolve to construct an elaborate query, which is also framework specific:

./make.ps1 "test-TestCategory=IronPython&Name=net8.0.IronPython.test_codecs" -framework net8.0

This PR adds the possbilility to query for the exact test name and reduce the verbosity of the query filter. The above test can be now filtered out and run on all supported frameworks concurrently by:

./make.ps1 test-IronPython.test_codecs

This is btw an excellent way to check is a given test is parallel-safe.

The old behaviour for queries that start with CPython or IronPython (matching by substring) can still be achieved by adding explicit Name~ to the query, e.g.

./make.ps1 test-Name~IronPython.test_codecs

Copy link
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Works for me! Probably won't remember the syntax for the old behaviour, but I guess if I'm using the full name I'm probably expecting an exact match anyway.

@BCSharp BCSharp merged commit 65a7afc into IronLanguages:main Feb 2, 2025
8 checks passed
@BCSharp BCSharp deleted the test_query branch February 2, 2025 04:45
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.

2 participants