5 Commits

Author SHA1 Message Date
calixteman
850020a84e
Address follow-up review comments in coverage_search.mjs
Use a Headers object for the request and log informational progress
messages via console.log instead of console.error.
2026-07-19 21:54:45 +02:00
calixteman
e6c7ab5425
Skip the cache existence check when --no-download is set
Move the `fs.existsSync(indexPath)` check below the `--no-download`
early return: in that mode the check is unused (the read after
refreshIndex already validates existence), so it's wasted disk I/O.
2026-07-19 16:42:05 +02:00
calixteman
c7dc7d7dd0
Sanitize the cached ETag and index to satisfy CodeQL
Address two CodeQL findings on the per-test index downloader:

- "File data in outbound network request": validate the cached ETag
  against the RFC 7232 grammar before sending it as If-None-Match, so
  the cache file's contents can't be injected into the request header.
- "Network data written to file": cache the re-serialized JSON
  (JSON.stringify(JSON.parse(...))) instead of the raw response body,
  so only well-formed JSON produced by our own serializer is written.
2026-07-19 16:13:20 +02:00
calixteman
d504000012
Download the per-test coverage index
`coverage_search` now fetches `per-test-index.json` from the pdf.js.refs
gh-pages branch, caches it locally, and only re-downloads it (via ETag)
when it changed, so querying which ref tests cover a line/function no
longer needs a local `--coverage-per-test` build. `--no-download` reuses
the cached index offline and `--index` points at a local one.

`browsertest` and `makeref` accept the same `--code` filter to run (or
regenerate refs for) only the covering tests, dropping any covered IDs
that aren't in this branch's manifest so the run isn't rejected.
2026-07-19 15:37:05 +02:00
Calixte Denizet
47f0bdc6a5
Use Istanbul instrumentation for unittestcli code coverage 2026-04-29 11:02:51 +02:00