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

Test run fails on netcoreapp1.0 targeted tests #466

Closed
AArnott opened this issue Jun 12, 2019 · 11 comments
Closed

Test run fails on netcoreapp1.0 targeted tests #466

AArnott opened this issue Jun 12, 2019 · 11 comments
Labels
documentation enhancement General enhancement request

Comments

@AArnott
Copy link
Contributor

AArnott commented Jun 12, 2019

When running tests on linux (in Azure Pipelines at least) with code coverage turned on...

dotnet test src --no-build -c Release --filter "TestCategory!=FailsInCloudTest" -v n -l trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

The build log shows this failure when the tests run on .NET Core 1.0:

[xUnit.net 00:00:01.64]       System.IO.FileNotFoundException : Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
[xUnit.net 00:00:01.64]       Stack Trace:
[xUnit.net 00:00:01.64]            at Coverlet.Core.Instrumentation.Tracker.Nerdbank.Streams_42ec0704-f64b-48c0-a903-a8b9be93bc98.RecordHit(Int32 )
[xUnit.net 00:00:01.64]         D:\a\1\s\src\Nerdbank.Streams\Sequence`1.cs(43,0): at Nerdbank.Streams.Sequence`1..ctor()
[xUnit.net 00:00:01.64]         D:\a\1\s\src\Nerdbank.Streams.Tests\BufferWriterStreamTests.cs(25,0): at BufferWriterStreamTests..ctor(ITestOutputHelper logger)
@AArnott AArnott changed the title Build fails Test run fails on netcoreapp1.0 targeted tests Jun 12, 2019
@MarcoRossignoli
Copy link
Collaborator

Yes I did some check and the issue seem mainly 2 packages
Mono.Cecil 0.10.1
Microsoft.Extensions.FileSystemGlobbing 2.0.1

that are supported only on netstandard2.0 and collector tfm is netcoreapp2.0

@vagisha-nidhi is there are reason to not build collector lib for netstandard2.0?
If so we could update guide to report that minimal support is netstandard2.0 runtimes.

@vagisha-nidhi
Copy link
Contributor

vagisha-nidhi commented Jun 12, 2019

@MarcoRossignoli Although the coverlet integration for now will be working for only .NET Core projects, that might be the reason of not making this netstandard targeted.

@MarcoRossignoli
Copy link
Collaborator

Fair I agree, is there a plan to support netfx?

@vagisha-nidhi
Copy link
Contributor

vagisha-nidhi commented Jun 12, 2019

Fair I agree, is there a plan to support netfx?

cc: @cltshivash @PBoraMSFT

@AArnott
Copy link
Contributor Author

AArnott commented Jun 12, 2019

I just checked, and Mono.Cecil actually targets netstandard1.3. Why do you say it requires netstandard2.0?

Also, an older version of Microsoft.Extensions.FileSystemGlobbing supports netstandard1.3 as well.

So maybe .NET Core 1.0 could be supported?

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jun 12, 2019

We use version https://github.com/tonerdo/coverlet/blob/master/src/coverlet.core/coverlet.core.csproj#L19 https://www.nuget.org/packages/Microsoft.Extensions.FileSystemGlobbing/2.0.1 for FileSystemGlobbing
For Cecil you're right...I misread...btw I retry because I get error on build moving to 1.0
EDIT: I had tested with netstandard1.0 Package Mono.Cecil 0.10.1 is not compatible with netstandard1.0 with 1.3 it's ok.

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jun 12, 2019

@AArnott maybe with some updates we could support on netstandard1.3 with downgrade to FileSystemGlobbing and removing ExcludeFromCodeCoverageAttribute usage on tracker template and skip "by hand".

C:\git\coverlet (master -> origin)                                                                                                                                                                        
λ dotnet build                                                                                                                                                                                            
Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Core                                                                                                                                      
Copyright (C) Microsoft Corporation. All rights reserved.                                                                                                                                                 
                                                                                                                                                                                                          
  Restore completed in 57,49 ms for C:\git\coverlet\src\coverlet.console\coverlet.console.csproj.                                                                                                         
  Restore completed in 58,5 ms for C:\git\coverlet\test\coverlet.collector.tests\coverlet.collector.tests.csproj.                                                                                         
  Restore completed in 57,73 ms for C:\git\coverlet\src\coverlet.collector\coverlet.collector.csproj.                                                                                                     
  Restore completed in 54,64 ms for C:\git\coverlet\test\coverlet.testsubject\coverlet.testsubject.csproj.                                                                                                
  Restore completed in 60,71 ms for C:\git\coverlet\src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj.                                                                                             
  Restore completed in 60,67 ms for C:\git\coverlet\src\coverlet.core\coverlet.core.csproj.                                                                                                               
  Restore completed in 60,36 ms for C:\git\coverlet\test\coverlet.core.performancetest\coverlet.core.performancetest.csproj.                                                                              
  Restore completed in 60,41 ms for C:\git\coverlet\test\coverlet.core.tests\coverlet.core.tests.csproj.                                                                                                  
  Restore completed in 25,52 ms for C:\git\coverlet\test\coverlet.core.tests\coverlet.core.tests.csproj.                                                                                                  
Instrumentation\ModuleTrackerTemplate.cs(16,6): error CS0122: 'ExcludeFromCodeCoverageAttribute' is inaccessible due to its protection level [C:\git\coverlet\src\coverlet.core\coverlet.core.csproj]     
  coverlet.testsubject -> C:\git\coverlet\test\coverlet.testsubject\bin\Debug\netcoreapp2.0\coverlet.testsubject.dll                                                                                      
                                                                                                                                                                                                          
Build FAILED.                                                                                                                                                                                             
                                                                                                                                                                                                          
Instrumentation\ModuleTrackerTemplate.cs(16,6): error CS0122: 'ExcludeFromCodeCoverageAttribute' is inaccessible due to its protection level [C:\git\coverlet\src\coverlet.core\coverlet.core.csproj]     
    0 Warning(s)                                                                                                                                                                                          
    1 Error(s)                                                                                                                                                                                            
                                                                                                                                                                                                          
Time Elapsed 00:00:03.60                                                                                                                                                                                  

@MarcoRossignoli
Copy link
Collaborator

@AArnott following up https://twitter.com/aarnott/status/1147714360757719041 I wonder if make sense for coverlet support framework out of LTS.
It's true that coverage is a "cross" activity and support old code could be a plus, maybe multitargeting.

cc: @tonerdo

@AArnott
Copy link
Contributor Author

AArnott commented Jul 8, 2019

I'm planning to cut support for it from my libraries at this point.

@tonerdo
Copy link
Collaborator

tonerdo commented Jul 11, 2019

I'm on board with cutting out support for < netstandard2.0

@MarcoRossignoli
Copy link
Collaborator

So I think that we can close this for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement General enhancement request
Projects
None yet
Development

No branches or pull requests

4 participants