You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by GitBox <gi...@apache.org> on 2026/08/13 06:28:05 UTC
[GH] (texera/gh-readonly-queue/main/pr-6471-7a6ee7cf9198de7b103bacf685b4237b804a6ef4): Workflow run "Required Checks" is working again!
The GitHub Actions job "Required Checks" on texera.git/gh-readonly-queue/main/pr-6471-7a6ee7cf9198de7b103bacf685b4237b804a6ef4 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).
Head commit for run:
86dd852085db10e8fe7c2db59a9232ef8347eb67 / Matthew B. <mg...@uci.edu>
test(frontend): cover the workflow-snapshot render path in ReportGenerationService (#6471)
### What changes were proposed in this PR?
Covers the last uncovered part of `ReportGenerationService`: the render
callback of
`generateWorkflowSnapshot`, which encodes the canvas html2canvas hands
back as a PNG and completes
the observable. No production code changed.
While this PR sat, main grew its own `report-generation.service.spec.ts`
(#7383, #7541), which
took over every case this branch originally added and left exactly one
gap — lines 93-95 of the
service:
```ts
.then((canvas: HTMLCanvasElement) => {
const dataUrl: string = canvas.toDataURL("image/png"); // 93
observer.next(dataUrl); // 94
observer.complete(); // 95
})
```
main's suite deliberately leaves the render alone ("it needs a real
canvas") and asserts only on
the image-inlining step that precedes it. This PR closes that gap, so
the merge keeps main's
version of the file wholesale and adds one `describe` on top of it.
| | statements | uncovered | tests in file |
| --- | --- | --- | --- |
| main | 126/129 (97.7%) | 93, 94, 95 | 24 |
| this PR | **129/129 (100%)** | none | 26 |
Branches stay at 25/25 and functions go from one uncovered (the callback
at line 92) to none.
**Why the original approach could not work.** The first version of this
test replaced the renderer
with `vi.mock("html2canvas", () => ({ default: vi.fn() }))`. That passes
on its own and fails in
CI, which is what the `build / frontend` job was reporting:
```
TypeError: Cannot read properties of null (reading 'scale')
❯ new ForeignObjectRenderer node_modules/html2canvas/dist/html2canvas.esm.js:7570:19
```
`@angular/build`'s unit-test runner sets `isolate: false` ("Default to
`false` to align with the
Karma/Jasmine experience"), so every spec file shares one module
registry. `MenuComponent`'s spec
pulls this service in transitively, so whichever spec loads html2canvas
first pins it for the whole
run — the mock reaches the spec's own import but not the
already-instantiated service, which keeps
the real module and dies on jsdom's unimplemented `getContext`. Solo,
nothing loads the service
first, so the mock applies and the test passes; that gap between the two
is why this only showed up
in CI.
So the real renderer is used instead, with jsdom given the three pieces
it lacks: a permissive 2D
context, an `<img>` that reports a data-URL source as loaded, and a PNG
encoder. That also lets the
failure path be pinned with a known error instead of jsdom's incidental
one.
### Any related issues, documentation, discussions?
Closes #6459
### How was this PR tested?
Two new cases, both run in the full-suite configuration that broke the
original:
```bash
cd frontend && yarn test:ci
```
`200 test files passed`, `4444 passed | 1 skipped`, up from `4442 passed
| 1 skipped` on main.
Coverage of `report-generation.service.ts` was read out of
`coverage/gui/coverage-final.json` from
that same full-suite run, on main and on this branch, to get the numbers
in the table above.
The file on its own:
```bash
cd frontend && npx ng test --watch=false --include='**/report-generation.service.spec.ts'
```
`26 tests` pass. `yarn format:ci` is clean.
### Was this PR authored or co-authored using generative AI tooling?
Yes, in compliance with ASF policy. The original spec was co-authored
with Claude Opus 4.8; the
conflict resolution and the CI fix were co-authored with Claude Code.
Generated-by: Claude Code (Claude Opus 5)
---------
Co-authored-by: Xinyuan Lin <xi...@uci.edu>
Report URL: https://github.com/apache/texera/actions/runs/31673333469
With regards,
GitHub Actions via GitBox