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

Empty results when generating coverage for Stripe.net #205

Closed
ob-stripe opened this issue Oct 1, 2018 · 5 comments
Closed

Empty results when generating coverage for Stripe.net #205

ob-stripe opened this issue Oct 1, 2018 · 5 comments

Comments

@ob-stripe
Copy link

Hi! I'm one of the maintainers of the Stripe.net library and I'm trying to add coverlet to our test pipeline. However, I can only seem to get empty results.

The test projects has two different targets netcoreapp1.1 and net452. I'm focusing on netcoreapp1.1 at the moment since my dev environment is .NET Core on a Macbook:

❯ ~/.dotnet/tools/coverlet src/StripeTests/bin/Debug/netcoreapp1.1/StripeTests.dll --target "dotnet" --targetargs "test -c Debug -f netcoreapp1.1 src/StripeTests/StripeTests.csproj"
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 45.76 ms for /Users/ob/workspace/dotnet/stripe-dotnet/src/StripeTests/StripeTests.csproj.
  Restore completed in 44.66 ms for /Users/ob/workspace/dotnet/stripe-dotnet/src/Stripe.net/Stripe.net.csproj.
Build started, please wait...
Build completed.

Test run for /Users/ob/workspace/dotnet/stripe-dotnet/src/StripeTests/bin/Debug/netcoreapp1.1/StripeTests.dll(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.7.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

Total tests: 472. Passed: 472. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 4.4366 Seconds


Calculating coverage result...
  Generating report '/Users/ob/workspace/dotnet/stripe-dotnet/coverage.json'

+------------+--------+--------+--------+
| Module     | Line   | Branch | Method |
+------------+--------+--------+--------+
| Stripe.net | 0%     | 0%     | 0%     |
+------------+--------+--------+--------+

If I run with --no-build, all tests fail with:

---- 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.

I'm not too sure what's that about, or if it's even related to the issue at hand.

I've looked at #188 which seemed like a similar issue, but our library doesn't use embedded PDBs -- there is no <DebugType> tag in the main project's .csproj, so it uses the default which is portable for .NET Core projects. I've also tried explicitly adding <DebugType>portable</DebugType> but it doesn't change anything.

If you want to try and reproduce, you can pull this branch: https://github.com/stripe/stripe-dotnet/tree/ob-coverage.

Any help would be greatly appreciated!

@tonerdo
Copy link
Collaborator

tonerdo commented Oct 4, 2018

Hi @ob-stripe, will try to reproduce it. I should mention that coverlet works this way when running without --no-build. The main problem to fix is the System.IO.FileNotFoundException that gets thrown

@ob-stripe
Copy link
Author

Ah, good to know @tonerdo -- I'll focus on trying to fix this error then.

@ob-stripe
Copy link
Author

I was able to successfully generate coverage by adding a netcoreapp2.0 target to the tests project. Is there maybe some incompatibility when using coverlet with a netcoreapp1.1 target?

@ob-stripe
Copy link
Author

Okay, I'm closing the issue since I was able to successfully compute coverage with a more recent version target. Thanks @tonerdo!

@tonerdo
Copy link
Collaborator

tonerdo commented Oct 4, 2018

@ob-stripe glad to hear that you figured it out. I don't think Coverlet works with any runtime version less than netcoreapp2.0

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

No branches or pull requests

2 participants