-
Notifications
You must be signed in to change notification settings - Fork 5k
feat(test-runner): test filter #33049
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials, Locator, APIResponse, PageScreenshotOptions } from 'playwright-core'; | ||
| export * from 'playwright-core'; | ||
|
|
||
| import type { TestCase } from './testReporter'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether it is okay to simply cross reference TestCase here…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is and it isn't, but let's solve other bits before resolving it.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"3 flaky35917 passed, 620 skipped Merge workflow run. |
|
When is testgroups.filter useful? |
|
Test group filtering is useful to make sure tests, which playwright wants to executed together, stay together (e.g. when they need to run sequential…). The logic which tests should be grouped together stays internal to playwright and all a user of playwright should know is which tests are grouped together, not why. If we do not expose test groups, users of playwright need to make assumptions of which tests should belong together, which is suboptimal as it might break playwrights contracts (e.g. when tests need to run in sequence…) |
|
@muhqu Thank you for the explanation. We've discussed this proposal, and here are some thoughts:
Given the above, I'd recommend to file an issue first, where we can outline the requirements and considerations before arriving to an API. We judge the interest of the community in the topic by engagement numbers on the issue, so that would be important for us. Additionally, given an issue, we will also be able to experiment with some ideas from our side, instead of blocking you for a long time or asking to try things that would eventually lead to nowhere. For example, one of the ideas we discussed is allowing tests with different worker hashes in the same worker, which might simplify the custom scheduling API quite a bit. |
|
@dgozman ok, this helps me understand what was meant by “low level api”. But given your list of requirements is clearly larger than mine, I think it makes more sense you come up with a feature request to make the test runner architecture more extensible… e.g. pluggable test runner strategies… that’s beyond what I was trying to solve. |
|
@dgozman I'd love to see this not die - there is an issue linked here - #17969 with 41 up votes. It would be great to see the team engage in the issue and..
we bet on muhqu's PR being merged, but we are at the point where there is a 20 minute difference between agents of our test runs and we would like to know if we should go back to our approach of splitting the tests ourselves and writing out a different config file per shard. |
Adds a new way for playwright users to filter the list of test cases using a function. It's similar to
grep, but instead of aRegExpyou can use a function.With this function it
shouldis be possible to implement a custom sharding mechanism as a user of playwright.New property: TestConfig.filter
Filter test cases by function.
TestFiltercan either be predicate function or an object withfilterTestsorfilterTestGroupsmethods.Usage
Or...
Or...