Closed bjornbouetsmith closed 1 year ago
I can see that github switched from ubuntu 20.04 -> 22.04 - forcing ubuntu 20.04 does not change anything unfortunately
Their ubuntu image versions changed from: https://github.com/actions/runner-images/blob/ubuntu20/20221027.1/images/linux/Ubuntu2004-Readme.md To https://github.com/actions/runner-images/blob/ubuntu20/20221119.2/images/linux/Ubuntu2004-Readme.md
And the only thing that springs to my mind is that .NET 6 was upgraded from 6.0.402 -> 6.0.403 and that net 7.0.100 was added - so perhaps the .NET 7 runtime is somehow making things not work?
I will try to update to VS 17.4 where .NET 7 is included - to see if I can reproduce it locally - and I will also update altcover - I can see you have released a new version that mentions .net 7.
Updating to VS 17.4 which includes .NET 7 makes coverage not being collected as well. Will now update altcover to latest version to see if that fixes the issue
okay - updating altcover to latest version: 8.5.841 does not change anything - so I am blocked now - it seems that .NET 7 breaks gathering of code coverage from altcover.
This looks like the known issue with dotnet test
using the 7.0.100 runtime -- see microsoft/vstest#4014 -- which loses the /p:whatever arguments to dotnet test.
Since the latest runtime on the machine is used by default, until 7.0.101, which is promised to contain a fix for this regression, arrives, options are (in order of how cumbersome they are)
global.json
like
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestMinor"
}
}
to stick with the known-good v6
dotnet test --no-build
Its unfortunate that github just installed .NET SDK 7 on all their runner images without any way of specifying that you want to use an older image.
But also unfortunate that microsoft did not fix the issue even when it was reported before the official release.
I just tested with the global.json - and it works kind of - on my developer machine I get code coverage generated - on github - with the exact same command line arguments - nada - still no code coverage.
Very strange.
But at least I have some way of moving forward - now I just need to find the "right" solution until either MS fixes the SDK - or github rolls back to not including .NET SDK 7 in all images.
Thank you very much
In your github actions, you can install the SDK of your choice via the setup-dotnet
action like
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.403'
and lock to that.
As used the the AltCover build here
I have this:
with:
dotnet-version: 6.0.x
Which should be similar - but I think my issue is that I had placed the global.json in a too deep directory - when in the "root" of the git repository it seems to be picked up correctly and code coverage are now being generated again :-)
So thank you very much
Hi,
I am using altcover to cover my project and suddenly without me changing anything in any project files - coverage has stopped being generated:
The last working build: https://github.com/bjornbouetsmith/ROOT.Zfs/actions/runs/3503109293
Outputs
The failing build and all subsequent ones goes straight from "Build completed"
So something makes altcover not prepare and instrument the assemblies being tested.
Can you come up with a reason why it would suddenly start without me changing any code?
I have checked the .NET version but both the old working and new failing are using the same version: 6.0.304, same with sonarscanner which is also being used in the build - and that version has also not changed. Also if I copy the test step to another action - it also fails.
When I run the exact same command line on my developer machine - it just works and altcover as expected outputs
So if I had to guess - the issue is probably that the "AltCoverRunPreparation" target is somehow not being run, but I have no idea how it suddenly happened.