test: vendor the NoNetwork fixtures from publiccode-parser-go

Aperta
#702 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, typescript
Ambito
testing, tooling

Direzione di ricerca

Start with src/wasm/go.mod, specs/add-e2e/spec.md sections 2.7, 5.1, and 5.2, and the existing fixture guard pattern in src/app/contents/publiccode.spec.ts. Then implement the fixture fetch script, Jest guard, and contributor bump procedure described in the issue; verify the acceptance criteria, including byte-for-byte reproduction at v5.4.3 and detection of a version mismatch.

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

Descrizione

Context

Sub-task T9 of #655. See specs/add-e2e/spec.md §5.1 and §5.2, and §2.7 (parser version drift: fixtures must be pinned to the parser version compiled into the WASM, currently v5.4.3 in src/wasm/go.mod).

Scope

Fixtures (e2e/fixtures/)

Committed at v5.4.3, keeping the source tree layout under testdata/v0/, including the assets/ folders:

Path Files Go test
valid/no-network/ valid.yml, valid_with_supports.yml TestValidTestcasesV0_NoNetwork
invalid/no-network/ landingURL_invalid, localisation_localisationReady_yaml11_{yes,no,on,off}, logo_invalid_png, logo_missing_file, monochromeLogo_invalid_png, supports_unknown_alias TestInvalidTestcasesV0_NoNetwork
valid_with_warnings/no-network/ authorsFile.yml TestValidWithWarningTestcasesV0_NoNetwork
invalid/ (optional) description_en_screenshots_missing_file.yml, logo_missing_url.yml TestRelativePathsOrURLsNoNetworkRemoteChecks

Plus SOURCE.json (repo, ref, resolved commit SHA, fetchedAt), LICENSE.EUPL-1.2 and NOTICE.md (origin and attribution).

Excluded: TestRelativePathsOrURLsNoNetwork, because it checks paths on the local filesystem, which the browser does not have.

scripts/fetchFixtures.ts + npm run e2e:fixtures
  • Arguments: --repo (default italia/publiccode-parser-go), --ref (default: the version read from src/wasm/go.mod).
  • Shallow, sparse, blob-filtered clone into a temp dir → sparse-checkout of the paths above → replace e2e/fixtures/testdata/v0/ → copy LICENSE → write NOTICE.md and SOURCE.json.
  • No authentication, touches nothing outside e2e/fixtures/. CI never downloads fixtures.
Guard

scripts/fixtures-source.spec.ts (Jest) fails if SOURCE.json.ref differs from the publiccode-parser-go version in src/wasm/go.mod, following the pattern of src/app/contents/publiccode.spec.ts.

Docs

Bump procedure in CONTRIBUTING.md:

  1. npm run e2e:fixtures -- --ref vX.Y.Z;
  2. review e2e/expectations.json against the new _NoNetwork tables;
  3. commit together with the parser bump.

Open decisions

  • Include the optional TestRelativePathsOrURLsNoNetworkRemoteChecks pair? Recommended: yes, it is the only parser test that reproduces the WASM's exact condition.
  • Licence: redistributing EUPL-1.2 test data, with attribution, inside this AGPL-3.0 repository. Maintainers to confirm.

Side effect

Dependabot / parser bump PRs fail the guard until the fixtures are refreshed. This is intended.

Acceptance criteria

  • npm run e2e:fixtures reproduces the committed tree byte for byte at v5.4.3
  • SOURCE.json, LICENSE.EUPL-1.2 and NOTICE.md are present
  • The Jest guard passes now and fails when go.mod and SOURCE.json diverge
  • The bump procedure is documented in CONTRIBUTING.md

Related

  • Parent: #655
  • No technical blocker; can proceed in parallel with T1–T8
  • Blocks: T10 (conformance), T11 (differential filling)
Lingua principale
TypeScript
Stelle
33
Fork
34
Merge medio
10h 50m
PR unite (30g)
13

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 italia/publiccode-editor

Tutte le issue di italia/publiccode-editor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.