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

'A total of 0 visits recorded' on Linux ARM runner #42

Closed
bearpawmaxim opened this issue Nov 29, 2018 · 14 comments
Closed

'A total of 0 visits recorded' on Linux ARM runner #42

bearpawmaxim opened this issue Nov 29, 2018 · 14 comments

Comments

@bearpawmaxim
Copy link

bearpawmaxim commented Nov 29, 2018

Hi!
Cannot get coverage information on ARM cpu-powered Linux CI runner machine because of getting 'A total of 0 visits recorded' message while the real coverage of my project is ~80%.
Can also notice, that running 'dotnet test' with AltCover switch on normal x86 machine produces coverage data.

dotnet SDK version: 2.1.500
OS: Debian Jessie softfloat

Steps to reproduce:

  1. Download any project from github, that is covered by unit-tests to your's ARM board (Raspberry Pi for example, can be done in emulated environment?) ;
  2. Add altcover .nuget package to test project;
  3. Run 'dotnet test /p:AltCover=true'.

Can provide additional info on your request. Thanks in advance!

@SteveGilham
Copy link
Owner

A couple of easy experiments while I'm getting a pi set up for development (and hoping that the current raspbian install will work)

  • are there separate .pdb files for the built binaries? (AltCover doesn't currently look for embedded debug information, though I think Cecil now supports that)
  • with dotnet test /p:AltCover=true --verbosity minimal, what does the extra output show?

@bearpawmaxim
Copy link
Author

Yes! There are .pdb files.
And the output is

Starting test execution, please wait...

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 26.4141 Seconds
... /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/altcover.xml.0.acv (b)
/home/gitlab-runner/.nuget/packages/altcover.dotnet/4.0.655/build/netstandard2.0/altcover.dotnet.targets(87,5): warning : A total of 0 visits recorded [/home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/Effortless.SqlBuilder.Tests.csproj]
Coverage statistics flushing took 2.959072 seconds
Visited Classes 0 of 60 (0)
Visited Methods 0 of 298 (0)
Visited Points 0 of 1633 (0)
Visited Branches 0 of 417 (0)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 0 of 60 (0)
Alternative Visited Methods 0 of 313 (0)

@bearpawmaxim
Copy link
Author

Also, can share my gitlab project if it will be helpful

@SteveGilham
Copy link
Owner

What I was looking for was the bit before the test execution, when the code is being instrumented. When dotnet test's implicit --verbosity none is overridden (and just raising it to minimal is enough), between the

Build completed.

Test run for...

there should be logging of the instrumentation task, like

Build completed.

  Creating folder $(OutputDir)\__Saved
  Saving files to $(OutputDir)\__Saved
  Instrumenting files in $(OutputDir)
     => $(OutputDir)\__Saved\[file1].dll
     => $(OutputDir)\__Saved\[file2].dll
...
  Coverage Report:...\coverage.xml


      $(OutputDir)\[file1].dll
                  <=  [assembly name of file1]
      $(OutputDir)\[file2].dll
                  <=  [assembly name of file2]
...
Test run for ...

If there's nothing there like that, it suggests that it's something different about the MSBuild environment on an ARM machine, such that the instrumentation step is being skipped entirely -- which would explain the lack of coverage being recorded.

@bearpawmaxim
Copy link
Author

Okay, here is the full build log

  Restore completed in 1.35 sec for /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder.SqlServer/Effortless.SqlBuilder.SqlServer.csproj.
  Restore completed in 1.35 sec for /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder.PostgreSql/Effortless.SqlBuilder.PostgreSql.csproj.
  Restore completed in 4.66 ms for /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder/Effortless.SqlBuilder.csproj.
  Restore completed in 25.14 ms for /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/Effortless.SqlBuilder.Tests.csproj.
Build started, please wait...
  Effortless.SqlBuilder -> /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder/bin/Debug/netstandard2.0/Effortless.SqlBuilder.dll
  Effortless.SqlBuilder.PostgreSql -> /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder.PostgreSql/bin/Debug/netstandard2.0/Effortless.SqlBuilder.PostgreSql.dll
  Effortless.SqlBuilder.SqlServer -> /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/src/Effortless.SqlBuilder.SqlServer/bin/Debug/netstandard2.0/Effortless.SqlBuilder.SqlServer.dll
  Effortless.SqlBuilder.Tests -> /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.Tests.dllBuild completed.

  Creating folder /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved
  Saving files to /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved
  Instrumenting files in /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/
     => /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved/Effortless.SqlBuilder.SqlServer.dll
     => /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved/Effortless.SqlBuilder.dll
     => /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved/NUnit3.TestAdapter.dll
     => /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved/Effortless.SqlBuilder.Tests.dll
     => /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/__Saved/Effortless.SqlBuilder.PostgreSql.dll

  Coverage Report: /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/altcover.xml


      /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/NUnit3.TestAdapter.dll
                  <=  NUnit3.TestAdapter, Version=3.10.0.21, Culture=neutral, PublicKeyToken=null
      /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.dll
                  <=  Effortless.SqlBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null      /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.Tests.dll
                  <=  Effortless.SqlBuilder.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
      /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.SqlServer.dll
                  <=  Effortless.SqlBuilder.SqlServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
      /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.PostgreSql.dll
                  <=  Effortless.SqlBuilder.PostgreSql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Test run for /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/bin/Debug/netcoreapp2.1/Effortless.SqlBuilder.Tests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 26.1245 Seconds
  ... /home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/altcover.xml.0.acv (b)
/home/gitlab-runner/.nuget/packages/altcover.dotnet/4.0.655/build/netstandard2.0/altcover.dotnet.targets(87,5): warning : A total of 0 visits recorded [/home/gitlab-runner/builds/f2ae85c2/0/ocheretianko.m/Effortless.SqlBuilder/test/Effortless.SqlBuilder.Tests/Effortless.SqlBuilder.Tests.csproj]
  Coverage statistics flushing took 3.284725 seconds
  Visited Classes 0 of 60 (0)
  Visited Methods 0 of 298 (0)
  Visited Points 0 of 1633 (0)
  Visited Branches 0 of 417 (0)

  ==== Alternative Results (includes all methods including those without corresponding source) ====
  Alternative Visited Classes 0 of 60 (0)
  Alternative Visited Methods 0 of 313 (0)```

@SteveGilham
Copy link
Owner

Thanks for that. So, not just a simple MSBuild issue after all.

I'll try for a simple repro locally over the weekend, then.

@bearpawmaxim
Copy link
Author

Thanks a lot!

@SteveGilham
Copy link
Owner

I have a repro (the first one of the simple sample programs from the AltCover tests I tried).

Test Run Successful.
Test execution time: 12.2672 Seconds
  ... /home/pi/Sample4/coverage.xml.0.acv (b)
/home/pi/.nuget/packages/altcover/4.0.655/build/netstandard2.0/AltCover.targets(87,5): warning : A total of 0 visits recorded [/home/pi/Sample4/sample4.core.fsproj]

Now to debug it.

@SteveGilham
Copy link
Owner

One serious refactoring later, the 4.0.659 release fixes this sort of issue, at least on my Pi 3.

@SteveGilham SteveGilham added the ready to close Believed addressed, waiting to hear to the contrary label Dec 2, 2018
@bearpawmaxim
Copy link
Author

Just updated project to mentioned by you 4.0.659 version and that solved my issue!
Thanks for helping!

@SteveGilham SteveGilham removed the ready to close Believed addressed, waiting to hear to the contrary label Dec 12, 2018
@bearpawmaxim
Copy link
Author

Hi!
Just updated to latest AltCover version and I'm now back on track with '0 visits' problem again. Now I have three projects: one large and two small (2-3 classes in each). And for these small test projects I'm getting a message about zero visits.

Can't you help me again?

@SteveGilham
Copy link
Owner

It may be a little while due to Real Life, but this is at the top of the stack.

@SteveGilham
Copy link
Owner

I've not been able to get any reliable repro, but I have done some tuning on the recording side in release 5.0.665, which may ameliorate this problem.

@SteveGilham SteveGilham added the cannot repro Need a simple case of the issue to work from label Feb 2, 2019
@bearpawmaxim
Copy link
Author

Yes, with version 5.0.665 my problem is gone. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cannot repro Need a simple case of the issue to work from enhancement
Development

No branches or pull requests

2 participants