Skip to content

[Bug]: --only-changed skips changed test files with non-ASCII names #43661

Closed

Description

Version

1.64.1 (same code on main)

Steps to reproduce

mkdir repro && cd repro && git init -q
npm init -y > /dev/null && npm i -D @playwright/test@1.64.1 > /dev/null
echo node_modules > .gitignore
echo "export default {};" > playwright.config.mjs
for name in plain cadastro-usuário; do
  printf "import { test } from '@playwright/test';\ntest('%s', () => {});\n" "$name" > "$name.spec.ts"
done
git add . && git commit -qm init

echo '// changed' >> plain.spec.ts
echo '// changed' >> cadastro-usuário.spec.ts
printf "import { test } from '@playwright/test';\ntest('ação', () => {});\n" > ação.spec.ts

git status --short
npx playwright test --only-changed --list

Expected behavior

All 3 tests are listed: the two modified files and the untracked one.

Actual behavior

Only the ASCII-named file is picked up:

 M "cadastro-usu\303\241rio.spec.ts"
 M plain.spec.ts
?? "a\303\247\303\243o.spec.ts"
Listing tests:
  plain.spec.ts:2:5 › plain
Total: 1 test in 1 file

A real run (without --list) passes, so in CI the changed tests just silently don't run.

Additional context

Git quotes paths with non-ASCII bytes by default (core.quotePath), so git diff --name-only and git ls-files --others print "cadastro-usu\303\241rio.spec.ts". detectChangedTestFiles in packages/playwright/src/runner/vcs.ts splits that output on \n and joins it with the root dir, so the quoted paths never match a real file. Changed helper files with such names go through the same list, so tests that import them aren't picked up either.

-c core.quotePath=false would cover non-ASCII names but not paths with ", \ or tabs, which git also quotes. Passing -z to ls-files and diff and splitting on \0 handles all of them. I patched that into 1.64.1 locally and all 3 tests get listed.

I'd like to send a PR with that fix and a test in tests/playwright-test/only-changed.spec.ts, if that works for you.

Environment

System:
  OS: Linux 7.0 Ubuntu 26.04.1 LTS
  CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics
Binaries:
  Node: 24.14.1
  npm: 11.11.0
  git: 2.53.0
npmPackages:
  @playwright/test: 1.64.1

Activity

  1. zerotohero3 commented on Oct 28, 2026

    @zerotohero3
    Author

    Heads up on #43678: core.quotePath=false only stops quoting non-ASCII bytes. Git still quotes names with ", \ or control chars:

    $ git -c core.quotePath=false diff HEAD --name-only
    "back\\slash.spec.ts"
    cadastro-usuário.spec.ts
    plain.spec.ts
    "say \"hi\".spec.ts"
    "tab\there.spec.ts"
    

    With -z you get the raw names for all of them, which is what I tested against 1.64.1. Happy to send that version with a test if you want to go that way.

  2. github-actions commented on Oct 28, 2026

    @github-actions
  3. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot and I reproduced this on Linux.

    Reproduced on main (1.65.0-next, 1b9b602724484df3ebc41aba77824fdfaba861f6). Git quotes these filenames, but --only-changed treats the quoted text as a literal path. The fix uses -z and NUL separators for both tracked and untracked file lists, without changing Git settings.

    Reproduction and verification

    I extended the existing list-mode test with a modified cadastro-usuário.spec.ts, an untracked ação.spec.ts, and a filename containing quotes, a tab, and a newline, alongside an ASCII file. Main lists only the ASCII file; the fix lists all four.

    I also built and tested #43678 at 29a509b424dc9c4c248a1cda9e62309b86062915. It lists the ordinary Unicode files, but still skips the name with quotes and control characters: three of four files.

    With the NUL-delimited fix, all 12 only-changed.spec.ts tests and all 18 related command-line-filter/Git-ignore tests pass. npm run build and npm run flint pass. These are browser-independent runner tests; no headed/headless or browser-specific runs were needed. Windows and macOS were not tested.

    Draft fix: #43726

    Triaged on Linux by the Playwright bot - agent run

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions