Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Apr 21, 2023

This PR:

  1. Enables unit tests to build and run on .NET 4.8, .NET Core 3.1 and .NET 6 targets.
  2. Runs all targets on windows
  3. Runs .NET6 on mac
  4. Collects code coverage for 3.1 and 6.0, since .NET Framework is not well supported in dotnet test.

@bitfaster
Copy link
Owner Author

bitfaster commented Apr 21, 2023

Looks like coverage result files will have target fwk like this:

image

dotnet test --no-restore --verbosity normal --no-build -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results6.trx"

Generates
image

This can be done per target, e.g.:

dotnet test --no-restore --verbosity normal --no-build -f netcoreapp3.1 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results3.trx"

dotnet test --no-restore --verbosity normal --no-build -f net48 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results4.trx"

However, 4.8 target fails to resolve the net standard BitFaster.Caching .dll so no tests run:

image

This appears to be caused by code coverage, because this command works correctly:

dotnet test --no-restore --verbosity normal --no-build -f net48 --logger "trx;LogFileName=results4.trx"

@coveralls
Copy link

coveralls commented Apr 22, 2023

Coverage Status

Coverage: 96.437% (-0.2%) from 96.671% when pulling debcf53 on users/alexpeck/multitest2 into 8b62b7b on main.

@bitfaster bitfaster marked this pull request as ready for review April 22, 2023 01:19
@bitfaster bitfaster mentioned this pull request Apr 22, 2023
@bitfaster bitfaster merged commit c4e8ade into main Apr 22, 2023
@bitfaster bitfaster deleted the users/alexpeck/multitest2 branch April 22, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants