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

Migrating to 2.0.0 #107

Closed
razzeee opened this issue May 22, 2018 · 12 comments
Closed

Migrating to 2.0.0 #107

razzeee opened this issue May 22, 2018 · 12 comments
Labels
bug Something isn't working

Comments

@razzeee
Copy link

razzeee commented May 22, 2018

Hey there,

just a quick heads up. When I update our sources to 2.0.0, it still runs the tests and works fine locally. But if I run it on our gitlab-ci the tests run and coverage gets reported as zero percent on the commandline.

@xtiancapil
Copy link

I'm seeing this also when I run on our jenkins-ci

@coenm coenm mentioned this issue May 23, 2018
@tonerdo tonerdo added the bug Something isn't working label May 24, 2018
@dlkay0
Copy link

dlkay0 commented May 24, 2018

Same results in this environment from command-line (1.2.0 works; 2.0.0 reports zero hits)

Linux 904f5451827d 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
.NET Command Line Tools (2.1.4)

Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190

Runtime Environment:
OS Name: ubuntu
OS Version: 17.10
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/2.1.4/

Microsoft .NET Core Shared Framework Host

Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54

Command-line:
dotnet restore && dotnet build --no-restore && dotnet test netcore2Hello.Test/ --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

using a different output format has no effect

@aburgett87
Copy link

@razzeee, @xtiancapil, @dlkay0 see my comments in #110, it looks like it's an issue with Linux and/or 2.0.5

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 3, 2018

Hi @razzeee @xtiancapil @dlkay0 did #110 fix this?

@razzeee
Copy link
Author

razzeee commented Jun 3, 2018

#110 is an issue and thus doesn't fix stuff ;)

So you're saying I should try #110 (comment) excluding the test adapter?

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 4, 2018

@razzeee yes that's what I meant. Sorry for not being more specific

@razzeee
Copy link
Author

razzeee commented Jun 4, 2018

So I did run dotnet test /p:CollectCoverage=true /p:Exclude=[NUnit3.TestAdapter]* on our linux CI server and it still reports 0% with version 2.0

Our docker image is based on microsoft/dotnet:2.0.5-sdk-2.1.4 I can update it, but it's quiet some work

@melih154
Copy link

melih154 commented Jun 7, 2018

For Windows Build Agent:

Downgrading coverlet.msbuild package to 1.2.0 worked on VSTS Windows Build Agent. Getting the code coverage report. Sonar publish working as well. Test Adapter is MSTest, haven't tested with others yet.

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 7, 2018

Thanks for the update @melih154, I'm still unable to reproduce this in Linux

@TruffleMuffin
Copy link

TruffleMuffin commented Jun 8, 2018

I had the same issue with core 2.1. I downgraded coverlet to 1.2 and all returns to normal.

Setup is jenkins-ci using aws codebuild and a custom linux image from the official docker dotnet-sdk.

Docker file is just "FROM microsoft/dotnet:2.1-sdk"

Build command

dotnet test MyTestProject.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutputDirectory=../Tests --logger:trx -r ../Tests

I have 0% coverage, but only for the "Web" project with Mvc etc in it. I have two other projects in the solution which have coverage coming from them correctly. That's all from the same build and test command

Hope that helps.

@dlkay0
Copy link

dlkay0 commented Jun 12, 2018

@aburgett87
I switched from 2.0.5 based on ubuntu to 2.0.7 based on official dotnet-docker:2.0.7-sdk-2.1.200 and excluded NUnit3.TestAdapter (/p:Exclude=[NUnit3.TestAdapter]*) and the combination yielded a valid coverage report using coverlet 2.0.0.

I've also managed to get colored source to display.

My issue is resolved.

@tonerdo tonerdo closed this as completed Sep 1, 2018
@razzeee
Copy link
Author

razzeee commented Sep 1, 2018

It's working for us again. Using the latest version in combination with dotnet core 2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants