4

I'm trying to configure a GitHub action:

My action contains the job for running the unit test by collecting code coverage. As I see in the log:

Test Run Successful.
Total tests: 336
     Passed: 336
 Total time: 14.0930 Seconds

Calculating coverage result...
  Generating report 'TestResults/coverage.netcoreapp2.1.info'

Nonetheless, after these lines log contains an error message:

  /home/runner/.nuget/packages/coverlet.msbuild/2.9.0/build/coverlet.msbuild.targets(31,5): error : Module test path not found [/home/runner/work/ObservableComputations/ObservableComputations/src/ObservableComputations.Test/ObservableComputations.Test.csproj]

The job is failed.

I tried to run

dotnet test --no-build --filter Name~Casting --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov

at my local machine (MS Windows) and didn't get this error.

Any help is greatly appreciated.

Igor Buchelnikov
  • 505
  • 4
  • 14

1 Answers1

4

The reason was in -no-build parameter for dotnet test. It seems coverage collecting requires dotnet test to build itself.

Igor Buchelnikov
  • 505
  • 4
  • 14
  • I get this error intermittently and also have --no-build. It's odd to me that it works most of the time, but not sometimes. Was it always not working for you? – Chad Mar 19 '21 at 21:29
  • 1
    When -no-build parameter is applied I always get this error when building in the GitHub action. When I removed the parameter I never saw this error again. In the MS Windows environment, I always have successful builds regardless of applying the parameter. – Igor Buchelnikov Mar 22 '21 at 07:48