[Bug]: --only-changed misses a test file when two ESM test files share an import
I maintainer di solito rispondono entro 1 giorno
@cpeaustriajc ci sta già lavorando.
Dal 31/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- nodejs, typescript
- Ambito
- testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 99.1k
- Fork
- 6.8k
- Merge medio
- 16h 3m
- PR unite (30g)
- 315
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/playwright#43741 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
microsoft/playwright#43834 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: `Update snapshot` sticky header in UI Mode Attachments panelForse già presa @microsoft-playwright-automation l’ha presa 1 giorno fa. Apertaneeds-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
microsoft/playwright#43833 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Let an MCP client label its own extension tab groupForse già presa @microsoft-playwright-automation l’ha presa 2 giorni fa. Apertaneeds-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
microsoft/playwright#43823 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: ariaSnapshot({ mode: 'ai' }) drops the name of dialogs, landmarks, tables and column headers when it comes from a visible descendantForse già presa @microsoft-playwright-automation l’ha presa 3 giorni fa. Apertaneeds-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
microsoft/playwright#43809 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright
Issue simili
-
Remove unused dependenciesForse già presa @alastair-smith l’ha presa oggi. Apertachore other
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alastair-smith/card-games#384 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
code-yeongyu/senpi#5571 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nexu-io/open-design#9262 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
friction
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
lingdojo/kana-dojo#33508 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno