Repository navigation
Skip the unit and E2E suites for screenshot-only changes - #785
Open
ryanwelcher wants to merge 1 commit into
Open
ryanwelcher wants to merge 1 commit into
ryanwelcher wants to merge 1 commit into
Conversation
The `changes` job in unit-tests.yml and e2e.yml now treats files under docs/public/ and scripts/screenshots/ as documentation, alongside Markdown. No test or packaged build loads them; docs/.vitepress/ still counts as code. Fixes #784
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Why
A docs PR that updates screenshots runs the full unit and E2E suites on macOS and Windows, though nothing in them can be affected. #777 is an example: Markdown, PNGs under
docs/public/screenshots/and two files inscripts/screenshots/.What changes
changesjob inunit-tests.ymlande2e.ymlnow treats files underdocs/public/andscripts/screenshots/as documentation, alongside*.md. A PR that touches only those skips the suites, and the*-skippedjobs report the required checks as passed, as they already do for Markdown.docs/.vitepress/still counts as code.tests/unit/download-button-platform.test.cjsloads a file from it.How to test this
Platforms: any. Nothing in the app changes. This PR edits the workflows themselves, so its own suites run in full.
Run the new filter against #777's file list from the repository root, in bash:
Expected: it prints
no code files: suites skipped.What must not have happened: a change that a suite does depend on must still run it. Replace the
gh apiline withprintf '%s\n' docs/public/a.png docs/.vitepress/config.mjsorprintf '%s\n' docs/a.md src/main.js. Each should print the code path, which means the suites run.Risks and limitations
node --testfinds test files anywhere in the repository, not only intests/unit/. A test file added underscripts/screenshots/would be skipped on its PR and first run on trunk. No such file exists today, so I left it alone rather than add a guard for it (see the review outcome).Related
Fixes #784
Review outcome (required, see AGENTS.md)
1 [fix here] · 0 [follow-up]. Deferred.
unit-tests.yml:62/e2e.yml:69: barenode --testdiscovers*.test.*,*-test.*,*_test.*,test-*.*andtest/**repo-wide, so a test file underscripts/screenshots/would not run on its PR. No such file exists, and AGENTS.md asks not to add branches for hypothetical cases. If one is ever added there, the filter needs a carve-out for test-named files.tests/unit,tests/e2e,src/oreslint-rules/readsdocs/public/orscripts/screenshots/(only comments mention them).build.filespackages onlypackage.json,src/andlocal-playground-web/. Renamed files count as code if either name is outside the skipped set.lint.ymlhas no path filter and does not ignorescripts/. No other workflow,.buildkitefile or doc describes the Markdown-only rule.npm run lintpassed;npm testpassed (2312 pass, 9 skipped, 0 fail)./self-review), on the uncommitted working tree at head78e9b3da/ base78e9b3da(trunk). Committed as2b0de984with no changes beyond the reviewed diff.🤖 Generated with Claude Code