| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #63054 +/- ##
==========================================
+ Coverage 90.30% 90.34% +0.03%
==========================================
Files 751 751
Lines 249116 249525 +409
Branches 47043 47145 +102
==========================================
+ Hits 224974 225429 +455
+ Misses 15509 15502 -7
+ Partials 8633 8594 -39
... and 34 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
|
Sweet! I'll try to carve out time on Saturday to reciew |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry for the delay. GitHub is having a bit of a stroke. Every time I try to add a comment to the review "Something went wrong" and I have to copy it, reload, paste, and try a couple more times.
I'll try to finish tomorrow (I got through 10 of 18 files, which doesn't include tag_filter.js).
Sorry, something went wrong.
| fail(nesting, loc, testNumber, name, details, directive, testId) { | ||
| fail(nesting, loc, testNumber, name, details, directive, testId, tags) { |
There was a problem hiding this comment.
General comment: this is getting to be a bit of a junk-drawer of arguments 😬
Sorry, something went wrong.
There was a problem hiding this comment.
I agree, perhaps we could open a good first issue Issues that are suitable for first-time contributors. issue to handle this
Sorry, something went wrong.
@JakobJingleheimer github having issues? no way 😂 |
Sorry, something went wrong.
| This feature requires `--allow-worker` if used with the [Permission Model][]. | ||
|
|
||
| ### `--experimental-test-tag-filter=<tag>` | ||
| ### `--experimental-test-tag-filter='<expr>'` |
There was a problem hiding this comment.
I'm not sure adding quotes helps here, to me at least that seems more confusing (e.g. git docs do not do that: https://git-scm.com/docs/git-log)
| ### `--experimental-test-tag-filter='<expr>'` | |
| ### `--experimental-test-tag-filter=<expr>` |
Sorry, something went wrong.
| * Identifiers—any non-whitespace, non-operator characters. A literal | ||
| identifier matches a tag of the same value (case-insensitive). | ||
| * `*` wildcards inside an identifier match any sequence of characters. | ||
| A bare `*` matches any tagged test. | ||
| * Boolean operators with two equivalent forms: | ||
| * `and` / `&&` | ||
| * `or` / `||` | ||
| * `not` / `!` | ||
| * Parentheses for grouping. |
There was a problem hiding this comment.
I'm not too keen on creating a new language for that. Let's either use JS (e.g. --experimental-test-tag-filter='(tag) => tag.startsWith("foo-")'), RegEx (e.g. --experimental-test-tag-filter=/^foo-/), or let's not add it into core
Sorry, something went wrong.
There was a problem hiding this comment.
Probably better if we have this conversation at: #63054 (comment)?
Having it in JS means we have a problem (can't serialize functions, so isolation: 'process' is not going to work straightforward). Using regex doesn't solve the problem of "is X or Y but not Z", which JS/DSL would..
Sorry, something went wrong.
There was a problem hiding this comment.
After discussing this face to face with @atlowChemi and @benjamingr I see the value in this. Considered some alternatives for allowing usage of tags via CLI, without the need to use run directly. it seems this is the best option.
compared to passing a function or a regex, and due to the fact it exists in other langauages and other test runners in the echosystem
Sorry, something went wrong.
|
I was also convinced:
So I'm +1 on this, it took me using the feature a bunch to understand this |
Sorry, something went wrong.
This would also be expensive as it would mean the tag evaluation which currently happens synchronously in the Test constructor, would have to become async (as we would have to wait for the message event for the response) and would require some noisy changes to ensure the test can't start while the evaluation hasn't completed |
Sorry, something went wrong.
|
@JakobJingleheimer @aduh95 are you OK with landing this? (see Moshe & Benjamin's recent comments) |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Upgrades the experimental tag filter introduced by stage 1 to accept a boolean expression instead of a literal tag name. Grammar: `and`/`&&`, `or`/`||`, `not`/`!`, parentheses for grouping, and `*` wildcards inside identifiers. Standard precedence (`not > and > or`); binary operators are left-associative. Word forms require whitespace separation; punctuation forms do not. Untagged tests evaluate `false` for any include expression and `true` for `not X`, so excluding tags does not accidentally remove untagged tests. The flag and `testTagFilters` option are still repeatable; multiple expressions still AND together. Malformed expressions fail fast at the parent process at startup. Tag value validation tightens to reject whitespace, operator characters (`& | ! ( ) *`), and the reserved words `and`/`or`/`not` in any casing - a breaking change relative to the stage 1 ship, acceptable at Stability 1.0 (Early development). Signed-off-by: atlowChemi <chemi@atlow.co.il>
Sorry, something went wrong.
Upgrades the experimental tag filter introduced by stage 1 to accept a boolean expression instead of a literal tag name. Grammar: `and`/`&&`, `or`/`||`, `not`/`!`, parentheses for grouping, and `*` wildcards inside identifiers. Standard precedence (`not > and > or`); binary operators are left-associative. Word forms require whitespace separation; punctuation forms do not. Untagged tests evaluate `false` for any include expression and `true` for `not X`, so excluding tags does not accidentally remove untagged tests. The flag and `testTagFilters` option are still repeatable; multiple expressions still AND together. Malformed expressions fail fast at the parent process at startup. Tag value validation tightens to reject whitespace, operator characters (`& | ! ( ) *`), and the reserved words `and`/`or`/`not` in any casing - a breaking change relative to the stage 1 ship, acceptable at Stability 1.0 (Early development). Signed-off-by: atlowChemi <chemi@atlow.co.il> PR-URL: #63054 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Upgrades the experimental tag filter introduced by stage 1 to accept a boolean expression instead of a literal tag name. Grammar: `and`/`&&`, `or`/`||`, `not`/`!`, parentheses for grouping, and `*` wildcards inside identifiers. Standard precedence (`not > and > or`); binary operators are left-associative. Word forms require whitespace separation; punctuation forms do not. Untagged tests evaluate `false` for any include expression and `true` for `not X`, so excluding tags does not accidentally remove untagged tests. The flag and `testTagFilters` option are still repeatable; multiple expressions still AND together. Malformed expressions fail fast at the parent process at startup. Tag value validation tightens to reject whitespace, operator characters (`& | ! ( ) *`), and the reserved words `and`/`or`/`not` in any casing - a breaking change relative to the stage 1 ship, acceptable at Stability 1.0 (Early development). Signed-off-by: atlowChemi <chemi@atlow.co.il> PR-URL: #63054 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
| Back | FazBrowse Home | New Git URL |
Summary
Builds on #63221, which landed the tags option, inheritance, reporter
event payloads, and a literal-tag-name filter. This PR upgrades the
filter to a boolean expression DSL:
and * wildcards inside identifiers (bare * matches any tagged
test). Standard precedence (not > and > or); binary operators are
left-associative. Word forms (and/or/not) require whitespace
separation; punctuation forms do not.
option now accept an expression rather than a literal tag name. The
flag is still repeatable; multiple expressions still AND together.
empty tag set; not X evaluates true. So not flaky keeps every
untagged test, while db excludes them.
whitespace, operator characters (& | ! ( ) *), or the reserved
words and/or/not in any casing. This is a breaking change
relative to test_runner: add tags option and tag-name filter #63221 - acceptable since the feature is at Stability 1.0
(Early development).
test file is spawned.
Prior art
Tag filtering with boolean composition is well-trodden in the JS
testing ecosystem. The expression syntax here is closest to Vitest's:
Vitest additionally lets a tag carry per-test config overrides such as
timeout or retry (with priority resolution between overlapping
tags). That's intentionally out of scope for this PR - landing it
would commit to a separate tags: [{ name, timeout, retry, priority }]
config surface that's orthogonal to filtering. It can be layered on
later without breaking the union-inheritance semantics established in
#63221.