Repository navigation
fix(e2e): seed the About credits the suite can no longer find - #674
Closed
JavierRibaldelRio wants to merge 1 commit into
Closed
JavierRibaldelRio wants to merge 1 commit into
JavierRibaldelRio wants to merge 1 commit into
Conversation
5029cf1 stopped committing credits.snapshot.json and the contributor avatars, because they are personal data in a public repository, and made them build-time artefacts instead. Nothing in the E2E job builds them: the workflow builds the four renderers and runs Playwright, so a fresh clone has no snapshot, getAboutCredits() returns an empty list and both About tests fail on `#contributors li` never appearing. It still passed locally, where a previous packaging run had left the files on disk. The suite cannot fetch them either. The About tests assert that the screen is entirely network-free, and making every pull request page through the GitHub commits API would be slow and fail for reasons unrelated to the change under test. So the renderer build now seeds a fixed, offline fixture: three members with distinct descending commit counts, a GitHub login each, and real PNG avatars encoded on the spot, so nothing binary needs committing. A generated snapshot already on disk is left untouched, so a developer's own build stays what the About tests exercise locally; it is replaced only when it lists nobody, is unreadable, or references an avatar that is gone, all of which would fail the same assertions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happens
Both About UI tests fail in CI on
expect(locator('#contributors li').first()).toBeVisible()— "element(s) not found" — while passing locally.5029cf1bstopped committingelectron-app/src/about/credits.snapshot.jsonandelectron-app/renderer/about/avatars/, since they are contributor photographs and per-person commit counts in a public repository, and made them build-time artefacts. Nothing in the E2E job builds them:e2e-tests.yamlbuilds the four renderers and runs Playwright, neverbuild:credits. So a fresh clone has no snapshot,getAboutCredits()returns{ contributors: [] }and About renders an empty list. It still passes on a developer's machine, where a previous packaging run left both on disk.What this changes
pnpm --dir e2e buildnow seeds the credits throughe2e/scripts/about-credits.mjs:The suite deliberately does not call the GitHub API: the first About test asserts the screen is entirely network-free, and paging the commits API on every pull request would be slow and red for reasons unrelated to the change under test.
Validation
node e2e/scripts/about-credits.mjs+getAboutCredits(): 3 contributors, counts[128, 57, 9]descending, everyavatarUrlmatching the renderer's./avatars/<id>.pngpattern and present on disk,name === loginsoabout:open-profileresolves tohttps://github.com/e2e-ada.naturalWidth > 0).prettier --checkclean. The full Playwright run is this PR's own E2E job: it needs Electron on a display, which the environment this was written in does not have.