coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.99k stars 386 forks source link

Fix integration test for .NET global tool on unix systems #660

Open MarcoRossignoli opened 4 years ago

MarcoRossignoli commented 4 years ago

For the moment we don't test .net global tool on unix systems because we get an "access denied" exception on ubuntu.

https://github.com/tonerdo/coverlet/blob/7cad9b3f58f2414d870a4cbe248ee8c93ed558a9/test/coverlet.integration.tests/DotnetTool.cs#L22

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 3 months with no activity.

Bertk commented 1 month ago

Standard output from test (Linux runtime ) uses a weird name for the coverage result file -'/home/bert/github/coverlet/artifacts/bin/coverlet.integration.tests/debug_net7.0/a8cbd011.json'

image
[xUnit.net 00:00:22.85]     Coverlet.Integration.Tests.DotnetGlobalTools.StandAloneThreshold [FAIL]
  Failed Coverlet.Integration.Tests.DotnetGlobalTools.StandAloneThreshold [7 s]
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at Coverlet.Integration.Tests.DotnetGlobalTools.StandAloneThreshold() in /home/bert/github/coverlet/test/coverlet.integration.tests/DotnetTool.cs:line 82
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Standard Output Messages:
 Hello World!

 Calculating coverage result...
   Generating report '/home/bert/github/coverlet/artifacts/bin/coverlet.integration.tests/debug_net7.0/a8cbd011\.json'
 +----------------------------------------+--------+--------+--------+
 | Module                                 | Line   | Branch | Method |
 +----------------------------------------+--------+--------+--------+
 | coverletsamplelib.integration.template | 66.66% | 100%   | 66.66% |
 +----------------------------------------+--------+--------+--------+

 +---------+--------+--------+--------+
 |         | Line   | Branch | Method |
 +---------+--------+--------+--------+
 | Total   | 66.66% | 100%   | 66.66% |
 +---------+--------+--------+--------+
 | Average | 66.66% | 100%   | 66.66% |
 +---------+--------+--------+--------+

 The minimum line coverage is below the specified 80
 The minimum method coverage is below the specified 80