Skip to content

fix(test runner): include jsxImportSource in transform cache hash - #42938

Closed
Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-42934
Closed

Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-42934

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • Include jsxImportSource (absolute path to playwright) in the transform cache key, so cached .tsx transforms aren't reused after playwright resolves to a different path.

Fixes #42934

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/video.spec.ts:690 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`

52297 passed, 1243 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/webmcp-dynamic.spec.ts:189 › a tool registered in an iframe can be called after the page is reloaded @mcp-ubuntu-latest-chrome

8763 passed, 1480 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🟢 The one failure is a pre-existing flake

mcp/webmcp-dynamic.spec.ts:189 also fails on main. This PR only changes the transform cache hash, and this test doesn't use that code.

Details

This PR changes packages/playwright/src/transform/transform.ts (adds jsxImportSource to the transform cache hash) and adds a test in tests/playwright-test/cache.spec.ts. The "tests 1" run has no failures, only 5 flaky tests. The "MCP" run has one failure.

Pre-existing flake / infra

  • [chrome] › mcp/webmcp-dynamic.spec.ts:189 › a tool registered in an iframe can be called after the page is reloaded (mcp-ubuntu-latest-chrome): the same test fails in places this PR can't affect.
    • It failed on main push 36037888265 (c69fc0b) on the same bot, mcp-ubuntu-latest-chrome. It also failed on main push 36076490274 (e17dffa) on mcp-macos-latest-chromium. Both times the error was Tool "webmcp_add" not found.
    • The same assertion failed on the unrelated PRs fix(mcp): rebind page-registered WebMCP tools when the tab or frame changes #42821 (firefox) and feat(chromium): roll to r1247 #42915 (chromium roll).
    • Across the test-results DB, the chrome project passed this test in 44 runs and failed in 1 before this PR. The test was added recently, so its history is short, but it switches between pass and fail on SHAs unrelated to this PR.
    • Those earlier failures look like the iframe tool is not registered again after the reload. I could not pull this run's error text from the job log, so I haven't confirmed it fails the same way. The test runs through the MCP server and the WebMCP tool bridge, not through the test runner's Babel transform or its cache.

Triaged by the Playwright bot - agent run

.update(filePath)
.update(version)
.update(pluginsEpilogue.map(p => p[0]).join(','))
.update(jsxImportSource || '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is essential that you use ?? instead, to pretend that you are using a coding agent.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: transform cache ignores jsxImportSource, so .tsx specs fail after playwright moves to another path

2 participants