Test, build, and share data

Preserve failure evidence

Upload test reports, screenshots, logs, and summaries even when the main test step fails.

9 minute lesson

~~~

Browser-test screenshots and a machine-readable report upload under a bounded retention policy after failure. This is a small part of a GitHub repository whose workflow tests, builds, packages, and deploys a small site through a protected environment, but the boundary it creates affects everything that follows.

CI failures need enough evidence to diagnose without rerunning blindly or exposing sensitive data. The useful target is not encyclopedic coverage. Make one deliberate choice, observe its consequences, and know which requirement would make you revise it.

Watch for one shortcut in particular: trying to dump every environment variable and raw request body into public logs. It makes later failures harder to locate. Instead, collect focused redacted evidence, use always-aware conditions carefully, and summarize the failing outcome. Prefer an implementation you can explain from the outside before optimizing it.

Keep the wider goal in view: Build a fast CI graph that preserves useful evidence without sharing mutable state accidentally. A short observation with concrete evidence is more useful than a confident sentence with no reproduction path.

Force a browser failure and diagnose it from the workflow page and artifacts without a local rerun. Hand the result to someone else and see whether the behavior is clear without an oral explanation.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →