Skip to content

fix(eest): make the fill report self-contained so it renders from S3#278

Merged
skylenet merged 1 commit into
masterfrom
fix-fill-report-self-contained
Jul 9, 2026
Merged

fix(eest): make the fill report self-contained so it renders from S3#278
skylenet merged 1 commit into
masterfrom
fix-fill-report-self-contained

Conversation

@skylenet

@skylenet skylenet commented Jul 9, 2026

Copy link
Copy Markdown
Member

Problem

Follow-up to #277. With the report links now redirecting to the presigned S3 URL, the EEST fill report opened/embedded unstyled. The pytest-html report links its stylesheet relatively:

<link href="assets/style.css" rel="stylesheet" type="text/css"/>

When the report loads from a presigned S3 URL (…/report_fill.html?X-Amz-Signature=…), the browser resolves assets/style.css to an unsigned S3 URL → 403 on the private bucket → no styling. (Verified against a real report: it's pytest-html, one inline <script>, and a single external asset assets/style.css.)

Fix

Add --self-contained-html to PYTEST_ADDOPTS for the fill run. pytest-html then inlines the CSS into report_fill.html, so the report is a single self-contained file with no assets/ references and renders fully styled from any URL — including the presigned S3 URL and the iframe embed.

EEST's filler plugin only sets htmlpath (.meta/report_fill.html) and does not set self_contained_html, so the flag is honored (confirmed in execution-specs filler.py). The JS is already inline, so nothing else needs bundling.

Why this over a server-side proxy

The alternative — streaming the report + its assets through the API so relative URLs resolve on the API origin — would serve our HTML same-origin as the API, giving up the origin isolation the presigned S3 URL provides (the report can't touch API cookies from the S3 origin). Fixing it at generation time keeps that isolation, needs no new route, and removes the sub-resource entirely instead of proxying it.

Scope

  • Applies to newly filled fixtures. Existing reports already on S3 keep their relative assets/ link until their next build re-generates the report.
  • No behavior change for the JSON sidecars or fixtures — only the pytest-html report output format.

go build + golangci-lint (--new-from-rev=origin/master) clean.

The pytest-html fill report (.meta/report_fill.html) linked its stylesheet
relatively as <link href="assets/style.css">. When the UI serves the report
from a presigned S3 URL (or embeds it in an iframe), that relative asset
resolves to an unsigned S3 URL and 403s, so the report renders unstyled.

Add --self-contained-html to PYTEST_ADDOPTS so pytest-html inlines the CSS
into report_fill.html — the report becomes a single file with no assets/
references and renders fully styled from any URL. EEST only sets htmlpath (not
self_contained_html), so the flag is honored.

This is the generation-time root fix and keeps the report on its own S3 origin
(no same-origin API proxy needed). Applies to newly filled fixtures; existing
reports render styled after their next build.
@skylenet
skylenet merged commit bef5e6b into master Jul 9, 2026
7 checks passed
@skylenet
skylenet deleted the fix-fill-report-self-contained branch July 9, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant