Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[quality] Guard tests/e2e spec registration: a misnamed spec is silently dropped from the Playwright run

Chiusa Adatta ai principianti
#876 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
testing

Direzione di ricerca

Inizia in tests/playwright-config.test.mjs, in particolare con il test esistente intorno alle righe 99-108, e controlla playwright.config.js per testIgnore. Esegui node_modules/.bin/playwright test --list --reporter=json, confronta le spec registrate con i file in tests/e2e e fai fallire il test per qualsiasi file non registrato o regola di esclusione dichiarata.

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

Descrizione

agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing

Finding

playwright.config.js sets testDir: 'tests/e2e' and declares neither testMatch nor testIgnore, so Playwright's default testMatch (**/*.@(spec|test).?(c|m)[jt]s?(x)) is what decides which files in that directory actually run.

tests/playwright-config.test.mjs:99-108 (points testDir at a directory that holds spec files) asserts only that the directory exists and contains at least one .spec.js file:

const specs = readdirSync(testDir).filter((entry) => entry.endsWith('.spec.js'));
assert.ok(specs.length > 0, `${config.testDir} contains no .spec.js files`);

Nothing asserts that every file in tests/e2e is registered. Consequences:

  • A spec committed as navigation.e2e.js, navigation-spec.js, or navigationSpec.js lands in tests/e2e/, is reviewed as e2e coverage, and is never executed.
  • A future testIgnore entry (or a narrowed testMatch) in playwright.config.js can drop existing specs with no failing test.

In both cases the End-to-end tests CI job stays green while the assertions never run. The whole e2e safety net for this site lives in that one directory, so a silently-unregistered spec is a real regression risk: it removes coverage while looking like it adds coverage.

Evidence

Fresh clone of cncf/endusers at commit ff93581, npm ci:

  • npx playwright test --list --reporter=json registers 19 spec files.
  • ls tests/e2e | wc -l counts 19 files on disk.

The sets match today, so this is a regression guard, not a present coverage gap. Unit coverage at the same revision (node tests/tools/coverage-report.mjs) reports src files 100.00% lines / 99.72% regions, and playwright.config.js is already exercised by tests/playwright-config.test.mjs — which is precisely why the missing assertion is easy to overlook.

Recommendation

Extend tests/playwright-config.test.mjs with an assertion that the set of files on disk under tests/e2e is exactly the set Playwright registers, resolved by asking Playwright itself rather than by re-implementing its glob:

  • Run the locally installed node_modules/.bin/playwright test --list --reporter=json (no browser download and no web server are required for --list; it completes in ~3s).
  • Compare the registered spec paths against readdirSync('tests/e2e'), and fail naming any file that is present but unregistered.
  • Assert that playwright.config.js declares no testIgnore, so an ignore rule cannot quietly shrink the suite.

This scope is deliberately confined to tests/playwright-config.test.mjs and does not overlap the currently open hold-gated PRs (#866 scripts/lib/mdx-escape.mjs, #873 scripts/lib/svg-active-content.mjs, #868 tests/coverage-gate-thresholds.test.mjs, #871 tests/validate-architecture-assets.test.mjs, #875 tests/sitemap-exclusions.test.mjs).

Priority

  • Impact: medium — no coverage is missing today, but the failure mode is silent loss of the entire e2e safety net
  • Effort: low — one test in an existing file

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: ff93581

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Lingua principale
JavaScript
Stelle
0
Fork
3
Merge medio
7h 35m
PR unite (30g)
579

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 cncf/endusers

Tutte le issue di cncf/endusers

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.