[Bug]: --only-changed misses a test file when two ESM test files share an import
メンテナーはふだん 1 日以内に返信
@microsoft-playwright-automation がすでに取り組んでいます。
2026年11月1日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 15/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- nodejs, typescript
- 領域
- testing
調査の方向性
Start with the ESM loader hooks in esmLoaderSync.ts and esmLoader.ts, where the resolve hook records dependencies, and compare them with collectCJSDependencies, which walks module.children. Check stopCollectingFileDeps and the --only-changed path. Pull request #43825 is already open against this issue, so review that work or the reproduction in tests/playwright-test/only-changed.spec.ts rather than starting a parallel fix. Done means both spec files are listed when a shared leaf changes.
索引モデルが issue の本文から書いたものです。
説明
Version
1.63.0, 1.64.1 and current main
Steps to reproduce
- Make a project with
"type": "module"inpackage.json. - Make
a.spec.tsandb.spec.ts. Both importshared.ts, andshared.tsimportsleaf.ts. - Commit, then change
leaf.ts. - Run
npx playwright test --only-changed --list.
Expected behavior
Both a.spec.ts and b.spec.ts are listed.
Actual behavior
Only the test file that loads shared.ts first is listed.
Additional context
In ESM mode, Playwright records dependencies in the loader's resolve hook (esmLoaderSync.ts and esmLoader.ts). Node calls resolve only when it first links a module. So the imports of shared.ts go only to the first test file that loads it. The CommonJS path (collectCJSDependencies) walks module.children and does not have this problem.
I have a fix ready. The resolve hook records each parent-to-child import edge, and stopCollectingFileDeps closes each test file's dependency set over those edges. A new test in tests/playwright-test/only-changed.spec.ts, "should understand dependency structure shared between esm test files", fails without the fix and passes with it. I can open a PR if you want it.
Environment
Node 26.12.1, macOS
- 主要言語
- TypeScript
- スター
- 99.1k
- フォーク
- 6.8k
- 平均マージ
- 16時間 3分
- マージ済み PR(30日)
- 315
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/playwright のほかの issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/playwright#43875 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
microsoft/playwright#43871 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: A paused clock still fires a timer the page sets while loading対応中かも @microsoft-playwright-automation が今日担当しました。 オープンneeds-triage
難易度 3/5 半日 初心者へのやさしさ 42/100
microsoft/playwright#43869 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Configure web servers per project対応中かも @microsoft-playwright-automation が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
microsoft/playwright#43853 · コメント 4 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: Extend isVisible/toBeVisible API to include overlap detection対応中かも @microsoft-playwright-automation が今日担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
microsoft/playwright#43849 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/playwright の issue をすべて見る
似ている issue
-
area: cli bug flake ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
gazetta-studio/gazetta-studio#1772 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
calagopus/panel#285 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 88/100
adobe/react-spectrum#10909 ·
メンテナーはふだん 1 日以内に返信