Unable to instrument module
See original GitHub issueI have a Xamarin Forms project which has unit tests written using NUnit targeting .Net Core 3.1. I am unable to get the code coverage generated due to an error/warning. Please find below the logs
/usr/local/bin/dotnet test /Users/runner/work/1/s/App.Test/App.Test.csproj --logger trx --results-directory /Users/runner/work/_temp --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=/Users/runner/work/1/s/TestResults/Coverage/ /p:CopyLocalLockFileAssemblies=true
/Users/runner/.nuget/packages/coverlet.msbuild/2.9.0/build/coverlet.msbuild.targets(31,5): warning : [coverlet] Unable to instrument module: /Users/runner/work/1/s/App.Test/bin/Release/netcoreapp3.1/Xamarin.Forms.Core.dll because : No symbol found for file: /Users/runner/work/1/s/App.Test/bin/Release/netcoreapp3.1/Xamarin.Forms.Core.dll [/Users/runner/work/1/s/App.Test/App.Test.csproj]
Test run for /Users/runner/work/1/s/App.Test/bin/Release/netcoreapp3.1/App.Test.dll(.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 16.7.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Results File: /Users/runner/work/_temp/_Mac-1606664309627_2020-11-29_15_42_20.trx
Test Run Successful.
Total tests: 15
Passed: 15
Total time: 1.4592 Seconds
Calculating coverage result...
Generating report '/Users/runner/work/1/s/TestResults/Coverage/coverage.cobertura.xml'
+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+
+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 100% | 100% | 100% |
+---------+------+--------+--------+
| Average | NaN% | NaN% | NaN% |
+---------+------+--------+--------+
```
Any help to resolve the issue is highly appreciated. Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13
Top Results From Across the Web
Coverlet is unable to instrument any modules for my test ...
When running this command (using coverlet underneath): dotnet test /p:CollectCoverage=true .\My.Test.Solution.sln.
Read more >Developers - [coverlet] Unable to instrument module - NET 5
[coverlet] Unable to instrument module - NET 5 - Microsoft.Extensions.Logging.Abstractions.
Read more >Customizing Code Coverage Analysis - Visual Studio
If both static and dynamic instrumentation is enabled, Visual Studio tries to instrument your C++ code statically, but if this is not possible...
Read more >Instrumentation Tests
In summary, an instrumentation test provides a special test execution environment as launched via the am instrument command, where the targeted application ...
Read more >Wallaby.js Introduction: Troubleshooting
'Failed to instrument filename'. Your compiled code failed to be parsed by Wallaby during the instrumentation phase (which uses acorn ).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MarcoRossignoli I have the same issue for net5.0 as well. 😭
Understand it label as known issue for now, appreciate if any solution.
@MarcoRossignoli : I am kind of stuck with this issue. It would be really helpful if you can take a look at this issue. Thanks.