Run web-platform-tests for the web APIs besides URL (Encoding, fetch, DOM events and abort, Blob, HTML globals) as committed suites in CI

Aperta
#2,491 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à
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, javascript

Direzione di ricerca

Start with the URL WPT suites and generator from #2442, scripts/regenerate-wpt-url-tests.js, tests/compliance/wpt-url.pin, and docs/testing.md to see how suites are generated and run in GocciaTestRunner -P tests. Then work on one scoped API area at a time, beginning with Encoding or fetch Headers/Response; identify applicable .any.js subtests and record exclusions and failures with reasons. Done means committed suites run in CI, applicable subtests pass, and docs/testing.md records coverage, the pin, and regeneration steps.

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

Descrizione

spec compliance

Summary

Run web-platform-tests (WPT) for the web APIs GocciaScript ships besides URL, as committed suites in the normal CI test run, the way #2442 did for URL. Those APIs are fetch (fetch, Headers, Response), Encoding (TextEncoder, TextDecoder), DOM events and abort (Event, EventTarget, AbortController, AbortSignal, DOMException), File API (Blob), and the HTML globals (atob, btoa, structuredClone, timers, queueMicrotask).

Why

test262 passes in full, but it covers only ECMAScript. Of the 39 issues labelled spec compliance opened from 20 Nov to 1 Dec, 19 were outside ECMAScript, and test262 could not have found any of them:

  • 11 were URL issues, 8 of them filed within 36 minutes on 29 Nov once WPT's URL data was run against the parser (#2379 to #2406).
  • 3 were fetch issues found by hand: #2315, #2333 and #2334.
  • 2 were about writing lone surrogates as U+FFFD: #2302 and #2306.

Since #2442, URL is checked against WPT on every run. The other web APIs have hand-written tests only, so their spec bugs turn up one at a time, when someone happens across them.

Current behavior

  • tests/built-ins/ has hand-written suites for Headers, Response, fetch, TextEncoder, TextDecoder, Event, EventTarget, AbortController, AbortSignal, DOMException, Blob, atob, btoa, structuredClone, Timers and queueMicrotask.
  • The only WPT-derived suites are URL's: wpt-urltestdata.js, wpt-setters.js and wpt-idna.js. scripts/regenerate-wpt-url-tests.js writes them at the pin in tests/compliance/wpt-url.pin (7171919f).
  • At that WPT revision, these directories hold tests that run outside a browser window (.any.js) as well as window- or HTML-only tests:
WPT directory .any.js window or HTML
encoding 25 19
fetch/api/headers 14 0
fetch/api/request 22 6
fetch/api/response 25 7
fetch/api/basic 33 5
dom/abort 4 3
dom/events 9 98
FileAPI/blob 11 6
html/webappapis/atob 1 0
html/webappapis/structured-clone 1 2
html/webappapis/timers 10 7
html/webappapis/microtask-queuing 2 2

Unlike URL's, most of these tests are testharness.js scripts, not JSON data files.

Expected behavior

  • A maintainer-only step fetches these WPT tests at one pinned revision and writes committed suites. Normal runs need neither Node.js nor the network, as with the URL suites.
  • The suites run in GocciaTestRunner -P tests in CI, and their results follow testharness.js semantics: each WPT subtest is one test, named as WPT names it.
  • Every subtest that applies to GocciaScript passes. One that is left out is listed with its reason: it needs a DOM or a window, a server, or an API GocciaScript does not ship. A failure that is a defect is filed and fixed, or listed with its issue until the fix lands.
  • docs/testing.md says what each suite covers, at which pin, and how to regenerate it.

Scope notes

  • One pull request per area (Encoding, fetch's Headers/Response, DOM events and abort, Blob, the HTML globals), so each is reviewable on its own. Encoding and Headers first: their tests need no network.
  • Tests that need wptserve, such as most of fetch/api/basic and responses fetched from the server, are out of scope here unless a local stand-in server covers them. List them as left out.
  • Window, DOM and HTML-document variants are out of scope, as they were for URL.
  • GocciaScript ships no Request (docs/built-ins.md lists fetch, Headers and Response), so fetch/api/request tests that construct one are left out until it ships; list them.
  • How to run .any.js files (a testharness.js shim over GocciaTestRunner, or translation into its test/expect form) is the implementer's choice. Record it in an ADR if it adds a new test-runner surface.
  • Related: #2442 (URL suites), #2130, #2302 and #2306 (U+FFFD output), #2315, #2333 and #2334 (fetch), #1562 (planned web APIs: MessageChannel, ReadableStream, crypto; add their WPT tests when each ships).

[!NOTE]
Created on behalf of @frostney using Claude Opus 5.5.

Lingua principale
Pascal
Stelle
21
Fork
6
Merge medio
13h 48m
PR unite (30g)
286

Preparare l'ambiente

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 frostney/GocciaScript

Tutte le issue di frostney/GocciaScript

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.