Skip to content

Tests: leave the working tree clean after a full run - #53

Open
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:FixTestRunTreeChurn
Open

Tests: leave the working tree clean after a full run#53
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:FixTestRunTreeChurn

Conversation

@Andrei-Errapart

@Andrei-Errapart Andrei-Errapart commented Aug 28, 2026

Copy link
Copy Markdown

Summary

Every full test run dirtied two tracked files: tests/COVERAGE.md (only its "Generated:" timestamp line changed) and TestData/Generated/Individual/PCB/BODY_3D_STEP_CHECKSUM0.PcbLib (rewritten with only the OLE directory FILETIMEs differing). This meant dotnet test always left the working tree dirty. After this change a full test run leaves all tracked files untouched.

Changes

  • CoverageReportTests.GenerateCoverageReport: drop the "Generated:" timestamp line from the coverage report and rewrite tests/COVERAGE.md only when its content actually changed.
  • tests/COVERAGE.md: regenerated once without the timestamp line.
  • RawDataPreservationTest.PcbLib_SaveWithZeroChecksum: save the zero-checksum PcbLib to the system temp directory instead of into TestData/.
  • FileComparisonTest.CompareOriginalAndWrittenPcbLib: regenerate the zero-checksum variant in memory (read BODY_3D_STEP.PcbLib, zero the model checksums, save to a MemoryStream) instead of reading the generated file from disk, which also removes the implicit ordering dependency on RawDataPreservationTest.
  • Untrack the generated fixture TestData/Generated/Individual/PCB/BODY_3D_STEP_CHECKSUM0.PcbLib.

Test Plan

  • Existing tests pass (dotnet test) — 850 passed, 10 skipped, 0 failed; git status reports no modified tracked files after the run
  • New tests added for new behavior — not applicable: test-infrastructure-only change, no new library behavior

Checklist

  • Code follows existing style and conventions
  • Public API changes are documented with XML doc comments — no public API changes in this PR
  • No breaking changes (or clearly identified below) — only test code and a generated test fixture are touched

Every test run dirtied two tracked files: tests/COVERAGE.md (only its
"Generated:" timestamp line changed) and TestData/Generated/Individual/
PCB/BODY_3D_STEP_CHECKSUM0.PcbLib (rewritten with only the OLE directory
FILETIMEs differing).

Drop the timestamp line from the coverage report and rewrite the file
only when its content actually changed. Save the zero-checksum PcbLib to
the system temp directory instead of TestData, make
FileComparisonTest regenerate that variant in memory rather than reading
the file from disk, and untrack the generated fixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant