Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0% Coverage Reported in GitHub Workflow #575

Closed
Rjae opened this issue Sep 28, 2019 · 11 comments
Closed

0% Coverage Reported in GitHub Workflow #575

Rjae opened this issue Sep 28, 2019 · 11 comments
Labels
needs more info More details are needed

Comments

@Rjae
Copy link

Rjae commented Sep 28, 2019

@MarcoRossignoli I just finished configuring a GH Actions workflow. All is well except my 100% coverage solution is reported as 0% running under GH Actions. The same project running on Travis (xenial) and local (Windows) is reported as 100%.

I've tried 2.2.108, 204, 401, 402 - along with 2.6.3. I tried all the workarounds listed on this thread, no luck. If you're aware of any other fixes I may try please let me know.

name: CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v1

    - name: Runtime
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.2.204

    - name: Tools
      run: dotnet tool install --global dotnet-reportgenerator-globaltool

    - name: Build
      run: dotnet build

    - name: Test
      run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=OpenCover /p:Exclude=\"[xunit.*]*,[*]*.Migrations.*\"

    - name: Report
      run: |
        export DOTNET_ROOT=/opt/hostedtoolcache/dncs/2.2.204/x64
        export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
        export PATH="$PATH:$HOME/.dotnet/tools"
        ~/.dotnet/tools/reportgenerator "-reports:*Tests/coverage.opencover.xml" "-targetdir:coverage-reports"

    - name: Artifacts
      uses: actions/upload-artifact@master
      with:
        name: Coverage
        path: coverage-reports
@Rjae
Copy link
Author

Rjae commented Sep 28, 2019

@Rjae you should try with collectors and version v2.2.401 or newer sdk, the issue could be related to vs test platform that kill process before hit files are written and could be dependant on ci machine load.

Originally posted by @MarcoRossignoli in #110 (comment)

@Rjae
Copy link
Author

Rjae commented Sep 28, 2019

Sadly, switching to collector did not resolve issue. Again, works locally (both collector and msbuild), on Travis, and on Jenkins.

@Rjae
Copy link
Author

Rjae commented Sep 28, 2019

@Rjae can you try to enable coverlet logging? msbuild collectors

Originally posted by @MarcoRossignoli in #110 (comment)

@Rjae
Copy link
Author

Rjae commented Sep 28, 2019

@MarcoRossignoli I finally had time to enable logging (see attached). Not knowing coverlet code yet, I mostly skimmed through. I did notice many socket exceptions in host log. Please let me know if there is something else I may try.
Logs.zip

@MarcoRossignoli
Copy link
Collaborator

Thanks I'll take a look at logs asap

@MarcoRossignoli MarcoRossignoli added the needs more info More details are needed label Sep 30, 2019
@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Sep 30, 2019

@Rjae can you try to upgrade to versione 1.1.0 https://www.nuget.org/packages/coverlet.collector/
attach your ci script(as above but with command for collectors+runsetting file)
and re-enable logs https://github.com/tonerdo/coverlet/blob/master/Documentation/Troubleshooting.md#collectors-integration and attach

If you can try also with nightly could be great we have new logs in place but with on-master version https://github.com/tonerdo/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md
New log https://github.com/tonerdo/coverlet/blob/master/Documentation/Troubleshooting.md#enable-injected-tracker-log

So we'll have a complete picture logs from collectors with last version and also logs from tracker(with these log we can understand if flushing hit files works as expected).

You should have logs from collectors as above and also one log for every dll instrumented/tested.

TL;DR;

From your current log I see one instrumented lib

TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.254, 184662326635, datacollector.dll, Excluded module filter '[coverlet.*]*'
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.254, 184662540635, datacollector.dll, Excluded module filter '[xunit.*]*'
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.255, 184662629634, datacollector.dll, Excluded module filter '[*]*.Migrations.*'
...
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.879, 185286910486, datacollector.dll, Instrumented module: '/home/runner/work/acv-logging-console/acv-logging-console/ACV.Logging.Console.Tests/bin/Debug/netcoreapp2.2/ACV.Logging.Console.dll'
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.879, 185287226585, datacollector.dll, Excluded module: '/home/runner/work/acv-logging-console/acv-logging-console/ACV.Logging.Console.Tests/bin/Debug/netcoreapp2.2/xunit.runner.utility.netcoreapp10.dll'
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.879, 185287343584, datacollector.dll, Excluded module: '/home/runner/work/acv-logging-console/acv-logging-console/ACV.Logging.Console.Tests/bin/Debug/netcoreapp2.2/xunit.runner.visualstudio.dotnetcore.testadapter.dll'
TpTrace Verbose: 0 : 3112, 1, 2019/09/28, 15:25:35.879, 185287459484, datacollector.dll, Excluded module: '/home/runner/work/acv-logging-console/acv-logging-console/ACV.Logging.Console.Tests/bin/Debug/netcoreapp2.2/xunit.runner.reporters.netcoreapp10.dll'

I see some exception on test run log.host.19-09-28_15-25-35_90115_4.txt System.NullReferenceException: Object reference not set to an instance of an object.
Do you see this exception also if you enable on local(succefully) run?I don't know if these are benign exception of vstest host, could be.

@MarcoRossignoli
Copy link
Collaborator

@Rjae you should try this #573 (comment)
It's possible that you're hitting same issue.

@MarcoRossignoli
Copy link
Collaborator

@Rjae any news?

@Rjae
Copy link
Author

Rjae commented Nov 8, 2019 via email

@MarcoRossignoli
Copy link
Collaborator

@Rjae any news?

@MarcoRossignoli
Copy link
Collaborator

Close for stale conversation.

Feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More details are needed
Projects
None yet
Development

No branches or pull requests

2 participants