Repository navigation
Replace Verify with in-house generator snapshot assertions - #150
Merged
Merged
Conversation
Verify 33.x adds a SponsorCheck build gate that fails the build unless a
sponsorship/licence MSBuild property is declared. Verify was only used for
14 source generator snapshot tests, so replace it with a small helper.
- Add GeneratorSnapshot, which compares each generated source against the
existing {Class}.{Test}#{HintName}.verified.cs files, writes .received.cs
on mismatch, flags stale snapshots, and fails on generator diagnostics or
exceptions
- Exclude *.verified.cs / *.received.cs from compilation (previously done
by Verify's MSBuild targets)
- Remove Verify.NUnit and Verify.SourceGenerators packages and the
dependabot group pattern
Enable options are applied before the native library is probed, so they take effect even when the library is unavailable. The test asserted the opposite in its library-unavailable branch, which CI never exercised.
Deterministic CI builds record CallerFilePath as /_/..., so snapshot files could not be found. Embed the repository root as assembly metadata and map /_/ paths back onto it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
==========================================
- Coverage 65.64% 65.63% -0.01%
==========================================
Files 337 337
Lines 30420 30420
Branches 5710 5710
==========================================
- Hits 19970 19967 -3
- Misses 9031 9034 +3
Partials 1419 1419
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Verify 33.x (pulled in by #149) adds a SponsorCheck build gate that fails the build (SC021) unless a sponsorship/licence MSBuild property is declared. Verify was only used by the 14 source generator snapshot tests, so this replaces it with a small in-house helper and drops the dependency.
GeneratorSnapshot, which compares each generated source against the existing{Class}.{Test}#{HintName}.verified.csfiles (unchanged), writes.received.cson mismatch, flags stale snapshots, and fails on generator diagnostics or exceptions*.verified.cs/*.received.csfrom compilation in both test projects (previously done by Verify's MSBuild targets)Verify.NUnit/Verify.SourceGeneratorsand theVerify*Dependabot group patternNativeCodecsTests.Initialize_WithEnableOptions_SetsProperties: enable options are applied before the native library is probed, so the library-unavailable branch asserted the wrong values (only reproducible where the native library is absent)Testing
.received.csfileAfter this merges, #149 only needs the NUnit 5 API fixes.
Summary by cubic
Verify 33.x adds a SponsorCheck build gate that fails the build unless a sponsorship MSBuild property is declared. Verify was only used for the 14 source generator snapshot tests, so this replaces it with a small in-house helper and drops the dependency.
GeneratorSnapshot, which compares each generated source against the existing{Class}.{Test}#{HintName}.verified.csfiles, writes.received.cson mismatch, flags stale snapshots, and fails on generator diagnostics or exceptions.*.verified.csand*.received.csfrom compilation in both test projects (previously handled by Verify's MSBuild targets).Verify.NUnit,Verify.SourceGenerators, and theVerify*Dependabot pattern.NativeCodecsTests.Initialize_WithEnableOptions_SetsProperties: enable options are applied before the native library is probed, so the library-unavailable branch was asserting the wrong values./ _/source paths back to the repository root, measured via aRepositoryRootassembly metadata item, so snapshot files resolve in deterministic builds.Written for commit fac71e3. Summary will update on new commits.