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

Documentation for selecting which test to run it outdated #2738

Closed
cschreib opened this issue Aug 26, 2023 · 1 comment
Closed

Documentation for selecting which test to run it outdated #2738

cschreib opened this issue Aug 26, 2023 · 1 comment

Comments

@cschreib
Copy link

cschreib commented Aug 26, 2023

Describe the bug
The documentation for selecting which test to run from the command line is outdated and incomplete.

Expected behavior
Here is what I noticed to be a mismatch; there may be more.

  1. Combination of multiple arguments:
a* ~ab* abc             Matches all tests that start with 'a', except those that
                        start with 'ab', except 'abc', which is included

This suggests that "<filter1> <filter2>" behaves like an OR operation, given the comment "except 'abc', which is included". Trying this in practice shows that 'abc' is not actually included. This suggests the real behavior is actually closer to an AND operation. The example should be updated.

  1. Commas:
A series of tags form an AND expression whereas a comma-separated sequence forms an OR expression.

This suggests that commas can be used for OR operations when filtering by tags, but in practice this also works when filtering by names, and in fact a comma can be put in between a name and a tag filter within the same "filter". It seems like it would be worth showing this as an example.

  1. Not sure about that one, but I think the order of the filters is now irrelevant?

Reproduction steps
Read the docs.

Platform information:
N/A

Additional context
Add any other context about the problem here.

@horenmar
Copy link
Member

Hmmm, that might not be outdated as much as just flat out wrong.

Not sure about that one, but I think the order of the filters is now irrelevant?

Actually I don't remember it being relevant in the last ~7 years. The closest the order comes to being relevant is that I think having negative matches at the end is more readable.

Commas:

Yes, commas are generally an OR, and it doesn't matter whether they are between tags, exact name, wildcarded name, or an AND-joined filter.

Combination of multiple arguments:

Technically this is not an OR, but rather successively applied filters. Some CLI utilities provide these, but I don't like them much in practice. The actual rules are that

  • without positive filters, all non-hidden tests are included by default
  • with positive filters, all tests that match them are included
  • matching with any negative filter disqualifies the test from being included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants