Closed nagesheaton closed 5 months ago
Hello @nagesheaton , this actions does not allow many unit test project.
If all pour test projets are in the samedi solution then you could try referencing the sln file instead of a csproj :
uses: b3b00/coverlet-action@1.2.5
with:
testProject: 'mySolution.sln'
output: 'lcov.info'
outputFormat: 'lcov'
excludes: '[program]*,[test]test.*'
threshold: 80
Please tell me if that answer your question
While running on Solution level I am getting two different reports.
Is there any way to get consolidated test report?
Also while running the Unittest in Visual Studio I am getting 90+ Coverage but <80 in this command.
Is there any specific reason? Or I have to add anything here explicitly ? Since I am able to see the projects covered in both of the cases is different.
If you see the report in Visual Studio it covers different Projects.
But some projects are missing in the coverlet command.
Maybe you have to exclude some projects from code coverage. Coverlet-action is only a gh action to use coverlet so for coverage report issue you should better look at how to use coverlet
Thanks for the help. I will check and update here by Tomorrow.
@nagesheaton , could you share if you find a reason for coverage difference ? and if so what was the issue ? it could help future users.
I am trying to add multiple test projects to the task but it is throwing that the project doesn't exist. I assume separation will be done through "," between two projects.
Here are the complete logs of the task. Run b3b00/coverlet-action@1.2.5 with: testProject: Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/Eaton.IoT.Asset.UnitTest.csproj output: lcov.info outputFormat: lcov excludes: [program],[test]test. threshold: 80 env: DOTNET_ROOT: C:\Program Files\dotnet starting... output : lcov.info format lcov UT project Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/Eaton.IoT.Asset.UnitTest.csproj excludes [program],[test]test. includes [program],[test]test. threshold 80 debug run dotnet test -c Debug -p:coverletOutput=lcov.info -p:CollectCoverage=true -p:CoverletOutputFormat=lcov -p:Exclude=\"[program],[test]test.\" Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/Eaton.IoT.Asset.UnitTest.csproj dotnet failed Checking threshold 80 MSBUILD : error MSB1009: Project file does not exist. Switch: Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/Eaton.IoT.Asset.UnitTest.csproj
Error: dotnet test failure Command failed: dotnet test -c Debug -p:coverletOutput=lcov.info -p:CollectCoverage=true -p:CoverletOutputFormat=lcov -p:Exclude=\"[program],[test]test.\" Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/Eaton.IoT.Asset.UnitTest.csproj Error: error occured : coverage file not found at Eaton.IoT.Asset/Eaton.IoT.Asset.Service.UnitTest/Eaton.IoT.Asset.Service.UnitTest.csproj,Eaton.IoT.Asset/Eaton.IoT.Asset.UnitTest/lcov.info coverlet test done.
Kindly help..!