Skip to content

Roborazzi: test happy path - no comment#52

Open
david-allison wants to merge 7 commits into
mainfrom
screenshot-test
Open

Roborazzi: test happy path - no comment#52
david-allison wants to merge 7 commits into
mainfrom
screenshot-test

Conversation

@david-allison
Copy link
Copy Markdown
Owner

Testing the 'happy path': Roborazzi with no screenshot changes

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@david-allison david-allison changed the title Roborazzi: test happy path Roborazzi: test happy path - no comment May 4, 2026
BrayanDSO and others added 6 commits May 5, 2026 13:43
Previously all `_actual.png` and `_compare.png` were in the root of the
Roborazzi output folder, which risked conflicts between different
*Test.kt output screenshots.

`Anki-Android/AnkiDroid/build/outputs/roborazzi`

Moving these files into `/StudyScreenScreenshotTest` meant that correct
and incorrect baselines were located in the same folder, which added
noise to the comparison

Structure:

```
roborazzi/StudyScreenScreenshotTest/
  Phone_BOX_false.png
  Phone_BOX_true.png
  Tablet_BOX_false.png
  diffs/ # one file from the root is copied, along with diagnostics
    Phone_BOX_false.png
    Phone_BOX_false_actual.png
    Phone_BOX_false_compare.png
```

Requested:
https://redirect.github
.com/ankidroid/pull/20943#pullrequestreview-4224241914

Somewhat related to 20942

Assisted-by: Claude Opus 4.7 - diagnostics, some implementation
Using Roborazzi for the implementation

* 'screenshot_store': runs on `main` store an artifact with
  a baseline
* 'screenshot_compare': an artifact is generated on PRs if changes are ,
  detected against `main`'s artifact
* 'screenshot_comment': if an artifact is generated, a PR comment is
added

Original sources

https://github.com/takahirom/roborazzi/blob/main/.github/workflows/CompareScreenshot.yml
https://github.com/takahirom/roborazzi/blob/main/.github/workflows/CompareScreenshotComment.yml
https://github.com/takahirom/roborazzi/blob/main/.github/workflows/StoreScreenshot.yml

- compare_screenshot_comment: quote the bot email so the [bot]
  brackets aren't interpreted by the shell
- StudyScreenScreenshotTest: keep per-test-class subdirectory in the
  capture path so future screenshot tests don't collide
- Use dedicated Roborazzi gradle tasks (compareRoborazziPlayDebug)
- Remove pinned workflows to match repo style
- Use open source gradle cache provider
- Rename workflows
- Add Apache header

Issue 20942

Assisted-by: Claude Opus 4.7
A branch was deemed too risky from a security perspective

Assisted-by: Claude Opus 4.7
* remove the nested folder tree (build/outputs/roborazzi)
* name the directory: screenshot-diff.zip contains
`screenshot-diff-pr-123` so conflicts don't occur and cleanup is easier

Assisted-by: Claude Opus 4.7 - all

Issue 20942
If the regressions were fixed, mark the PR as resolved
Do not post a comment if one already existed

Issue 20942

Assisted-by: Claude Opus 4.7 - all
Store only needs to be executed on `main`

We run on some file changes, in case they break the upload process, but
this is only defensive.

Note: this does upload artifacts, this could be avoided, but the
complexity makes the 'happy path' of this workflow harder to reason
about.

Issue 20942

Assisted-by: Claude Opus 4.7
Setting a property via the Gradle-generated 'propName value' or
'propName(value)' syntax in Groovy DSL has been deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants