Add xUnit V3 project variants for shared tests/tools other repos consume.#9876
Draft
MichaelSimons wants to merge 2 commits intodotnet:mainfrom
Draft
Add xUnit V3 project variants for shared tests/tools other repos consume.#9876MichaelSimons wants to merge 2 commits intodotnet:mainfrom
MichaelSimons wants to merge 2 commits intodotnet:mainfrom
Conversation
Introduce new XunitV3 copies of the packable test infrastructure assemblies (Microsoft.TemplateEngine.TestHelper.XunitV3 and Microsoft.TemplateEngine.Mocks.XunitV3) to enable downstream repos (sdk, aspnet, wpf) to incrementally adopt xUnit v3. - Add xunit.v3 and Verify.XunitV3 package versions to Directory.Packages.props - Add #if XUNIT_V3 preprocessor guards in shared source files where v2/v3 APIs differ (namespace changes, new ITestOutputHelper members, nullable GetValue returns) - New .XunitV3 projects compile the same source with XUNIT_V3 defined - Existing v2 projects remain unchanged Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…heir tests Create XunitV3 duplicates of TemplateVerifier, TemplateApiVerifier, and their UnitTests and IntegrationTests projects. Use shared .props files to minimize duplication between V2 and V3 project definitions. - Extract common properties, package refs, and project refs into Shared.props files for all 4 project pairs - V3 projects link source from V2 via Compile Include and define XUNIT_V3 constant - V3 TemplateVerifier uses Verify.XunitV3 + xunit.v3 packages - V3 TemplateApiVerifier swaps project refs to V3 versions shared CommandUtils files and test source files - V3 tools projects share PublicAPI.*.txt from V2 via AdditionalFiles Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
df38f78 to
0e377b9
Compare
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
Adds xUnit V3 versions of the TemplateVerifier, TemplateApiVerifier, and their test projects alongside the existing V2 versions. The V2 projects remain unchanged for external consumers. Introduces shared
.propsfiles across all V2/V3 project pairs (including the pre-existing Mocks and TestHelper) to minimize duplication.New projects
Microsoft.TemplateEngine.Authoring.TemplateVerifier.XunitV3tools/Microsoft.TemplateEngine.Authoring.TemplateApiVerifier.XunitV3tools/Microsoft.TemplateEngine.Authoring.TemplateVerifier.UnitTests.XunitV3test/Microsoft.TemplateEngine.Authoring.TemplateVerifier.IntegrationTests.XunitV3test/Approach
.propsfiles extract commonPropertyGroup,PackageReference, andProjectReferenceitems so that V2 and V3.csprojfiles only contain what differs (xunit package versions andXUNIT_V3define).<Compile Include>— no code duplication.PublicAPI.*.txtfiles are shared via<AdditionalFiles>where the public API surface is identical (TemplateVerifier, TemplateApiVerifier). TestHelper keeps separate files due to xunit namespace differences.#if !XUNIT_V3conditionals added where xunit V2/V3 APIs differ:Xunit.Abstractions→ auto-imported in V3 (shared CommandUtils files, test files)UseVerifyAttributeremoved inVerify.XunitV3(VerificationEngine.cs)