History

Check for uncommitted unignored generated archives on CI

This adds a step to `test-fast` to run `git diff` and fail if there are any changes to any tracked files, and sets the newly recognized `GIX_TEST_CREATE_ARCHIVES_EVEN_ON_CI` environment variable for the `nextest` step in which fixture scripts are run. Any changes would indicate a problem that should be addressed, but the main goal here is to catch when a regenerated archive has not been committed. Because adding archives to `.gitignore` would also cause this to pass but is far less often the appropriate solution, this change includes a comment about what the best solution *usually* is. This is added to the `test-fast` jobs but not to `test` job because the `test` job uses `GIT_TEST_IGNORE_ARCHIVES` to prevent already existing archives from being used, which will nearly always result in at least slightly different archives being generated. So in the `test` job this would, in practice, always give a false-positive failure. Because archive generation is (at least currently) suppressed on Windows, this step should rarely if ever fail on Windows even when the problem it is looking for is present. But if it does fail on Windows, then there is a problem that ought to be investigated, and if the problem it is looking for is present, then it will still fail on the other systems, unless the problem is specific to Windows. Running this step on both Ubuntu and macOS (and Windows), rather than just Ubuntu (and Windows), has the benefit of catching some kinds of skew. It is also somewhat simpler than setting it only for some operating systems.

Eliah Kagan committed 2 years ago

Commit de95f241 parent 94c6d701 file · +4 −0Browse files

Unified · Split

.github/workflows/ci.yml+4−0
@@ -92,9 +92,13 @@ jobs: · 91 unmodified lines
9292 with:
9393 tool: nextest
9494 - name: "Test (nextest)"
95+ env:
96+ GIX_TEST_CREATE_ARCHIVES_EVEN_ON_CI: 1
9597 run: cargo nextest run --all --no-fail-fast
9698 - name: Doctest
9799 run: cargo test --doc
100+ - name: Check that tracked archives are up to date
101+ run: git diff # If this fails, the fix is usually to commit a regenerated archive.
98102
99103 test-32bit:
100104 runs-on: ubuntu-latest

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t