Repository navigation
Move the GeneratorTests files A to M to DependencyModules.Specs - #137
Merged
Merged
Conversation
This commit only moves the files. The next commit converts them to [VerifyTest], so git keeps the history of each file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Fact] becomes [VerifyTest], [Theory] with [InlineData] becomes [Row], [MemberData] becomes [RowSource], and the Assert calls become Verify, Single, NotNull and ThrowsExactly. Each test keeps its name, its rows and its checks. The VerificationGlue.Tests runner runs the rows of one test at the same time. Two rows that compiled the same library loaded two copies of it, and the second copy replaced the first in the assembly resolver. So GeneratorTestHarness.CompileLibrary now returns the copy that is already loaded for the same name and source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p-vgdm-generator-a-m # Conflicts: # CONTRIBUTING.md
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 changed
The 46 files in
tests/DependencyModules.Tests/GeneratorTestsfromApplicationModuleCollisionTests.cstoModuleParameterAccessibilityTests.csmove totests/DependencyModules.Specs/GeneratorTests. The 10 snapshots that they read (GlueFuncTests.*andModuleGenerationSnapshotTests.*) move totests/DependencyModules.Specs/Snapshots. The first commit only moves the files, so git keeps the history of each file. The second commit converts them.[Fact]becomes[VerifyTest].[Theory]with[InlineData]becomes[VerifyTest]with[Row], with the same values in the same order.[MemberData]becomes[RowSource].DiagnosticSuppressionTests.Triggersyields(string Code, string Source)tuples.ModelComparerTests.DifferingConfigurationsyields(string, DependencyModuleConfigurationModel)tuples and setsDeterministicReplay = true, because a model value cannot give a row ID.Assertcalls becomeVerify,Single,NotNullandThrowsExactly.Assert.Allbecomes aforeachloop withVerify. A value typedobjectis compared withEquals, and a sequence is compared withSequenceEqual.ConventionContractTests,nameof(IConventionModule) == GeneratorNames.ConventionModuleis a constant, and VG0002 reports that it checks nothing. The check now readstypeof(IConventionModule).Name.GeneratorTestHarness.CompileLibraryreturns the library that is already loaded when the name and the source are the same. The VerificationGlue.Tests runner runs the rows of one test at the same time. Before this change, two rows ofEnvironmentAttributesFromSymbolsTests.ADecoratorFromAReferencedAssembly_KeepsItsEnvironmentAttributeeach loaded a copy ofEnvironmentDecoratorPackage. The second copy replaced the first in the assembly resolver, so the first row did not find itsIGreeterservice.The branch merges main at 0158a19, which moved the N to Z files (#139). Both changes edited the same CONTRIBUTING.md sentence. The merged sentence says that
tests/DependencyModules.Specshas theRuntimeTests,ApiTestsandGeneratorTestsfolders, because noGeneratorTestsfile stays intests/DependencyModules.Testsnow.Why
This step moves DependencyModules' own unit tests to the
[VerifyTest]runner, so that a failed check shows its expression and the values in it.How it was tested
[Fact]and 548[VerifyTest]methods without rows, 171[InlineData]and 171[Row]attributes, and 3 member-data tests that give 18, 18 and 10 rows. I compared the--list-testsoutput of the Specs project with these counts for each method name, and they match: these files give 765 tests.dotnet execon the Specs test application passed 1055 of 1055 tests in three runs in a row../scripts/coverage.sh 85passed. It ran DependencyModules.Tests (131 of 131 on net8.0 and net10.0), the integration test projects, and the Specs project under coverlet. Line coverage is 92.8 percent../scripts/test-xunit.sh 4passed. DependencyModules.Tests passed 132 of 132 on net8.0 and net10.0, and the Specs project passed 1055 of 1055.dotnet csharpier check .passed.I did not run
./scripts/verify-packages.sh, because this change does not touch the packages. The moved tests now run on net10.0 only, because the Specs project targets only net10.0. Before, they also ran on net8.0.🤖 Generated with Claude Code
Opened by Agent Driver for step
stp-vgdm-generator-a-mof Tasktsk-verificationglue.