I'm seeing different behaviors for the IncludeTestAssembly property depending on how I invoke a test using Microsoft.Testing.Platform. It's unclear to me if this is expected behavior, but from my understanding / perspective, these scenarios should all be using Microsoft.Testing.Platform, and thus should all behave the same.
Repro steps
- Clone repo
git clone https://github.com/microsoft/codecoverage.git
cd codecoverage/samples/Algorithms/tests/Algorithms.Core.Tests/
- Add TestingPlatformDotnetTestSupport
<PropertyGroup>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>
dotnet run
dotnet run --coverage --coverage-output report.cobertura.xml --coverage-output-format cobertura
Result: Tests are not included in report.cobertura.xml
dotnet test
dotnet test -- --coverage --coverage-output report.cobertura.xml --coverage-output-format cobertura
Result: Tests are not included in report.cobertura.xml
dotnet coverage
dotnet tool install -g dotnet-coverage
dotnet-coverage collect --output report.cobertura.xml --output-format cobertura "dotnet run --no-build"
Result: Test are included in report.cobertura.xml
This is Scenario04 in the samples. Given that this is also supposed to be using the MSTest runner according to https://github.com/microsoft/codecoverage/blob/main/samples/Algorithms/README.md, I'd expect this to output the same as the other two entrypoints.