OSOE-1308: Migrate test SDKs to Microsoft Testing Platform - #24
Conversation
| @@ -1,5 +1,4 @@ | |||
| <Project> | |||
| <Import Project="$(MSBuildThisFileDirectory)../../Lombiq.MSBuild.Base.Sdk/Sdk/Import.props" /> | |||
| <Import Project="$(MSBuildThisFileDirectory)../../Lombiq.MSBuild.OrchardCore.Tests.Sdk/Sdk/Import.props" /> | |||
There was a problem hiding this comment.
Is this necessary? This SDK is afaik only used by all those *.Tests.UI libraries that contain extension methods to be used in tests rather than actual tests. So I think this would only make the test execution slower by trying to discover tests in libraries that definitely have none.
There was a problem hiding this comment.
Not actually. I misunderstood what this project is for and wanted to cut down on sme repetition.
There was a problem hiding this comment.
Having reverted this, I'm not so sure anymore. It feels like The Tests SDK and the UI Tests SDK should be pairs. Now there's a distinction due to how we usually approach these tests (given how unit tests are just in their test project, while for UI tests we have libraries and test projects) because of their different nature. However, that should be reflected in the SDK too.
Maybe a separate SDK for the libraries?
There was a problem hiding this comment.
If it wasn't such a hassle I'd rename Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk to Lombiq.MSBuild.OrchardCore.Tests.UI.Library.Sdk or something along those lines.
I don't think these two need to be pairs, because if you want a project to run tests it should always have the Tests.Sdk. If you want a standalone UI test project you set the SDK to Tests.Sdk and import the Core.props (and technically the Core.targets, though that's empty rn) from Tests.UI.Sdk like this:
<Project Sdk="Lombiq.MSBuild.OrchardCore.Tests.Sdk/version">
<Import Project="Core.props" Sdk="Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk" Version="version">
<Import Project="Core.targets" Sdk="Lombiq.MSBuild.OrchardCore.Tests.UI.Sdk" Version="version">
</Project>There was a problem hiding this comment.
I'm thinking that a UI test project should only import the UI test SDK, and nothing else (much like unit test projects do this with the Tests SDK). I also thought about renaming it to Library.
Migrate the unit test SDK to the executable xUnit runner and Microsoft Testing Platform, including GitHub Actions reporting, TRX reports, and hang dumps. Remove VSTest dependencies and document runner selection and central package management.
The UI test SDK retains its library behavior for reusable test helpers. Executable UI test projects use Lombiq.MSBuild.OrchardCore.Tests.Sdk and reference Lombiq.Tests.UI explicitly.
Part of Lombiq/Testing-Toolbox#92. Coordinated integration: Lombiq/Open-Source-Orchard-Core-Extensions#1335.
Validation: local UI SDK packaging succeeds, and a restored UI helper consumer evaluates as a library. The coordinated SDK prerelease 2.1.1-alpha.2.osoe-1308 is published and available on NuGet. With the published SDK, the NuGet UI consumer discovers 44 tests and all 35 NuGet unit tests pass. The local root build succeeds with zero warnings/errors. SDK publication and PR checks pass.
OSOE-1308