fix(tools): screenshot diff fails a screen without a baseline once any is committed
A screenshot without a baseline only warned, so with no baseline committed every screen was "new" and the CI step could not fail, and a screen added after the first baselines could stay ungated for good. Now the baseline folder is armed as soon as it holds a PNG: from then on a screen without its own baseline fails (Verdict.Unbased, an error annotation). Before the first baselines the run says plainly, in its warning and in bold in the job summary, that it compared nothing and that no visual change can fail it. The baselines README explains why the existing ci-screenshots pictures cannot serve (captured before the clock was fixed: times and dates follow the capture moment) and how the first set is accepted from the first green windows-latest run of the reproducible capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+86
-23
No files matched your search
@@ -11,7 +11,10 @@ dotnet run --project src/Titano.Tools -- screenshots diff out/screenshots --out
|
||||
- A pixel differs when one of its channels moves by more than `--tolerance` (default 8 of 255); a screen fails when
|
||||
more than `--max-diff` of its pixels differ (default 0.0005, that is 0.05 %), when its size changed, or when a
|
||||
baseline here has no screenshot any more.
|
||||
- A screenshot without a baseline only warns.
|
||||
- A screenshot without a baseline fails as soon as this folder holds any PNG: a pull request that adds a screen adds its
|
||||
baselines too.
|
||||
- While this folder holds no PNG nothing is compared: the step passes, with a warning and a bold line in the job summary
|
||||
saying that no visual change can fail it.
|
||||
- `out/screenshot-diff` gets `<screen>-diff.png` for every screen with differing pixels (the baseline faded to grey, the
|
||||
differences magenta) and `summary.md`; CI uploads them as the `screenshot-diff` artifact and adds the summary to the
|
||||
job page.
|
||||
@@ -40,3 +43,10 @@ git worktree remove ../ci-screenshots
|
||||
|
||||
`screenshots accept <dir>` copies every PNG of `<dir>` here. Commit only the screens whose change is intended, and delete
|
||||
the baseline of a screen that no longer exists.
|
||||
|
||||
## The first baselines
|
||||
|
||||
None is committed yet. Screenshots captured before the capture was made reproducible cannot serve: their times and
|
||||
dates follow the moment they were taken (a job finished at "12:18 AM", sample sequences dated from that day). The first
|
||||
baselines are accepted, all at once, from the `ci-screenshots` commit of the first green `windows-latest` run whose
|
||||
code captures at `SampleData.Now`; from that commit on, every screen is gated.
|
||||
Reference in new issue
Block a user