includeAllFiles can add a duplicate placeholder on Windows when path casing differs

Aperta
#1,018 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cypress, typescript
Ambito
testing-qa

Direzione di ricerca

Start in includeAllFiles in lib/task-utils.ts, where covered entry paths are normalized to forward slashes and compared exactly to tinyglobby results. First confirm on Windows which working-directory setups yield mismatched drive-letter or path casing, since the issue has not been reproduced. Done means a Windows-only case-insensitive comparison that prevents the duplicate 0% placeholder while POSIX matching stays unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

While working on #360, a review turned up a related edge case in includeAllFiles (lib/task-utils.ts) that seemed worth tracking on its own rather than folding into that fix.

What happens

To decide whether a globbed file is already covered, includeAllFiles converts each covered entry's path to forward slashes and compares it to the tinyglobby path with an exact, case-sensitive string match. Windows paths aren't case-sensitive, though. So if the two sides disagree only on casing, for example the drive letter (c:\proj\src\a.js from the instrumenter vs C:/proj/src/a.js from the glob), the file isn't recognized as covered and gets a second, empty placeholder entry.

Why it matters

The same file then shows up twice in the report, once with real coverage and once at 0%. That drags the totals down and can make --check-coverage fail.

Status

I haven't reproduced this in a real run yet. It comes from reading the code, so the first step is confirming which setups actually produce mismatched casing (Git Bash vs cmd.exe working directories are a likely suspect). If it's real, a fix could compare a case-folded form of the path on Windows only, leaving POSIX matching untouched.

Lingua principale
TypeScript
Stelle
440
Fork
114
Merge medio
42m
PR unite (30g)
19

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cypress-io/code-coverage

Tutte le issue di cypress-io/code-coverage

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.