Add split-by-example support for Playwright#443
Add split-by-example support for Playwright#443jeffal wants to merge 2 commits intobuildkite:mainfrom
Conversation
|
Hi @niceking, I fixed the failing tests. |
| // [Buildkite Test Collector - Playwright implementation](https://github.com/buildkite/test-collector-javascript/blob/42b803a618a15a07edf0169038ef4b5eba88f98d/playwright/reporter.js#L47) | ||
| // [Playwright titlePath implementation](https://github.com/microsoft/playwright/blob/523e50088a7f982dd96aacdb260dfbd1189159b1/packages/playwright/src/common/test.ts#L126) | ||
| // [Playwright suite structure](https://playwright.dev/docs/api/class-suite) | ||
| func mapSpecToTestCase(spec PlaywrightSpec, suiteName string) plan.TestCase { |
There was a problem hiding this comment.
I think this is copied/extracted from lines 97-108. Could we replace those lines with this new function so we don't have duplicate?
There was a problem hiding this comment.
Done. getTestResultsFromSuite now calls mapSpecToTestCase.
| changeCwd(t, "./testdata/playwright") | ||
|
|
||
| playwright := NewPlaywright(RunnerConfig{ | ||
| // Use npx directly because yarn adds prefix output to stdout that corrupts JSON parsing |
There was a problem hiding this comment.
What happens if the user sets a custom command to use yarn? Will the getExamples function fail?
I think we should handle the case where user use yarn. Can we save the json output to a temporary file and parse that file instead of reading the raw stdout
There was a problem hiding this comment.
Fixed. The json output now goes to a temp file via PLAYWRIGHT_JSON_OUTPUT_NAME env var, bypassing stdout entirely.
|
Thanks for opening the PR @jeffal, it looks good overall. The only issue is that parsing the stdout with |
|
Hi @jeffal, just checking if you had a chance to look at the issue I posted? |
Implement GetExamples() for the Playwright runner using `playwright test --list --reporter=json` to enumerate tests without running them.
c021cd0 to
7afe3aa
Compare
Sorry for the delay! Both issues are addressed and I've rebased on latest main branch. |
Implement
GetExamples()for the Playwright runner to enable splitting slow test files by individual test example.Uses
playwright test --list --reporter=jsonto enumerate tests without running them, similar to how RSpec uses--dry-runand pytest uses--collect-only.