You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: custom reporter API for test sharding #40934
We'd like to implement a shard balancing logic in Flakiness.io Playwright reporter: since we have all the history for test runs across environments, we have enough data to balance shards.
We know there's --test-list API that we can use to generate a list with tests (and that's what we use for prototyping). However, this is not an ergonomic API for our clients: it requires them to change their CI configuration.
Custom Reporter API is a better integration point: there's already a full information for the upcoming test run.
Example
It would be nice if custom reporters had an early asynchronous hook that could inspect the resolved test suite and return a custom test list before execution starts.
For example, a reporter method called in the beginning of the run would do:
interfaceReporter{/** * Called before the test run starts. Allows the reporter to customize * the list of tests that will be executed. Returns an array of test case Ids. */selectTests?(config: FullConfig,suite: Suite): undefined|Promise<undefined|string[]>;}
Motivation
Consider this Supabase CI: if they were to try using --test-list with Flakiness.io, they'd need to amend their workflow configuration.
Additionally, if they were passing any custom arguments like --grep to their future npx playwright test run, they'd need to mirror them to the test-list generation command.
Dmitry Baev (@baev) I think you'd also be interested in this - we're thinking of exposing it via a separate config field as opposed to extending Reporter, what do you two think?
Simon Knott (@Skn0tt) thanks for asking. Yes, we’re looking forward to having this feature implemented. From our POV, the fewer config changes people have to make to configure Allure, the better. So, we would prefer a reporter hook instead of a separate config field.
I feel similar, but it makes our Reporter a bit of a misnomer. Is there a convincing story for the role of Reporter that would allow it to have this method without feeling icky?
Also, I think we'd want the selectTests result to carry some kind of a disposition; so on top of sharding it can be used to mark some tests as fixme/skipped according to a platform/feature matrix. What kinds of dispositions would you like to see in the context of your systems Dmitry Baev (@baev)Andrey Lushnikov (@aslushnikov)?
The test plan feature lets Allure control which tests should run without turning Allure into a test framework. Allure decides the target subset, writes that subset as a testplan.json, and the test-framework adapter, for example allure-playwright, applies the filter before selected tests execute.
For users, the expected behavior is simple: when they choose a subset of tests, only those tests run. Tests outside the plan should not execute their body, per-test fixtures, steps, or helper code, and they should not appear as artificially skipped results. If the plan is missing, invalid, unsupported, or empty, the run falls back to normal execution.
This supports two main flows:
allure run can automatically rerun failed tests. After the first pass, Allure 3 finds failed or unsuccessful tests, creates a temporary testplan.json, sets ALLURE_TESTPLAN_PATH and ALLURE_RERUN, then launches the same command again for only that subset.
When a run is triggered from Allure TestOps, the selected tests can be passed to the execution as an Allure test plan. The adapter filters the framework run automatically, so users do not need to manually translate TestOps selection into Playwright grep patterns or custom runner flags.
We already implemented this for allure-playwright using monkey-patching. Users can try it by adding the latest allure-playwright reporter and running their normal Playwright command through allure run, for example:
To filter discovered Playwright tests, the adapter needs access to enough data from each discovered test to build the same identity that Allure uses in the plan:
test name/title
full file path or project-relative test file path
title path / suite hierarchy
stable fullName or equivalent selector generated from file path plus title hierarchy
Playwright tags and annotations
Allure ID from explicit metadata or tags such as @allure.id=123 / @allure.id:123
framework-native selector, if Playwright exposes one that is stable enough
We discussed it with the team, i'll add a filter to Config. It initially means one more thing to configure for the user, but that can be solved separately via merging configs / plugins.
Activity
Skn0tt commentedon May 26, 2026
Dmitry Baev (@baev) I think you'd also be interested in this - we're thinking of exposing it via a separate config field as opposed to extending
Reporter, what do you two think?baev commentedon May 27, 2026
Simon Knott (@Skn0tt) thanks for asking. Yes, we’re looking forward to having this feature implemented. From our POV, the fewer config changes people have to make to configure Allure, the better. So, we would prefer a reporter hook instead of a separate config field.
Skn0tt commentedon May 27, 2026
I feel similar, but it makes our
Reportera bit of a misnomer. Is there a convincing story for the role ofReporterthat would allow it to have this method without feeling icky?Also, I think we'd want the
selectTestsresult to carry some kind of a disposition; so on top of sharding it can be used to mark some tests as fixme/skipped according to a platform/feature matrix. What kinds of dispositions would you like to see in the context of your systems Dmitry Baev (@baev) Andrey Lushnikov (@aslushnikov)?baev commentedon May 27, 2026
The test plan feature lets Allure control which tests should run without turning Allure into a test framework. Allure decides the target subset, writes that subset as a
testplan.json, and the test-framework adapter, for exampleallure-playwright, applies the filter before selected tests execute.For users, the expected behavior is simple: when they choose a subset of tests, only those tests run. Tests outside the plan should not execute their body, per-test fixtures, steps, or helper code, and they should not appear as artificially skipped results. If the plan is missing, invalid, unsupported, or empty, the run falls back to normal execution.
This supports two main flows:
allure runcan automatically rerun failed tests. After the first pass, Allure 3 finds failed or unsuccessful tests, creates a temporarytestplan.json, setsALLURE_TESTPLAN_PATHandALLURE_RERUN, then launches the same command again for only that subset.When a run is triggered from Allure TestOps, the selected tests can be passed to the execution as an Allure test plan. The adapter filters the framework run automatically, so users do not need to manually translate TestOps selection into Playwright grep patterns or custom runner flags.
We already implemented this for
allure-playwrightusing monkey-patching. Users can try it by adding the latestallure-playwrightreporter and running their normal Playwright command throughallure run, for example:allure run --rerun 2 -- npx testExample plan:
{ "version": "1.0", "tests": [ { "id": "123", "selector": "tests/login.spec.ts#auth > logs in" } ] }To filter discovered Playwright tests, the adapter needs access to enough data from each discovered test to build the same identity that Allure uses in the plan:
fullNameor equivalent selector generated from file path plus title hierarchy@allure.id=123/@allure.id:123Pseudo-code:
The core contract: Allure provides the selected test set;
allure-playwrightmakes Playwright execute only that set.Skn0tt commentedon May 27, 2026
We discussed it with the team, i'll add a
filterto Config. It initially means one more thing to configure for the user, but that can be solved separately via merging configs / plugins.test(test-runner): cover Reporter.plan suite filtering contract
feat: adopt the new sharding API (#75)