Skip to content

NaN% in cover report #586

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

Closed
leyou240 opened this issue Oct 10, 2019 · 8 comments
Closed

NaN% in cover report #586

leyou240 opened this issue Oct 10, 2019 · 8 comments
Labels
needs more info More details are needed

Comments

@leyou240
Copy link

leyou240 commented Oct 10, 2019

I'm newbie to use coverlet into my ci build. And use coverlet .\bin\Debug\whatever\whatever.dll --target "dotnet" --targetargs "test --nobuild"
I use it on windows works well, but unfortunately on linux where ci run show NaN% coverage and Total also get error that all is 100%. Below is generated report.

Calculating coverage result...
Generating report '/path/coverage.json'
+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+

+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 100% | 100% | 100% |
+---------+------+--------+--------+
| Average | NaN% | NaN% | NaN% |
+---------+------+--------+--------+

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Oct 10, 2019

Try to add project path

coverlet .\bin\Debug\whatever\whatever.dll --target "dotnet" --targetargs "test PROJECT TEST PATH --nobuild"

Seem that test doesn't run...so no coverage results.

like in a guide https://github.com/tonerdo/coverlet#global-tool

@MarcoRossignoli MarcoRossignoli added the needs more info More details are needed label Oct 10, 2019
@leyou240
Copy link
Author

Tests runs well except coverage results, more details shows below.

$ dotnet tool install --global coverlet.console
Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile

Add .NET Core SDK tools

export PATH="$PATH:/root/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:/root/.dotnet/tools"

You can invoke the tool using the following command: coverlet
Tool 'coverlet.console' (version '1.6.0') was successfully installed.
$ export PATH="$PATH:/root/.dotnet/tools"
$ coverlet .\bin\Debug\netcoreapp2.2\XUnitTestProject1.dll --target "dotnet" --targetargs "test --no-build"
Test run for /builds/wlydapi/Wlyd.Titan/WLYD.Titan.Backend/XUnitTestProject1/bin/Debug/netcoreapp2.2/XUnitTestProject1.dll(.NETCoreApp,Version=v2.2)
Microsoft (R) Test Execution Command Line Tool Version 16.2.0-preview-20190606-02
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
[xUnit.net 00:00:17.17] XUnitTestProject1.TitanDataTests.alreadyTookcount_should_equl_InDistributionCount_add_AppropriateCount [SKIP]
[xUnit.net 00:00:17.33] XUnitTestProject1.TitanDataTests.alreadyTooknumber_should_equl_InDistributionnumber_add_Appropriatenumber [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Respostory.UserInfoRepositoryTests.test_insert_should_return_id [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Respository.Bms.InBoundSkuItemRepositoryTests.querry_should_return_list [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Respository.Bms.InBoundDeliveryOrderRepositoryTests.query_should_return_list [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Respository.Bms.BmsJobConnectionRepositoryTests.test_query_sholud_return_null [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Bms.BmsDataPullTest.inbound_order_data_pull_test [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Bms.BmsDataPullTest.order_data_pull_test [SKIP]
[xUnit.net 00:00:17.34] XUnitTestProject1.Bms.BmsDataPullTest.bms_outbounddelivey_order_pull_test [SKIP]
! XUnitTestProject1.TitanDataTests.alreadyTookcount_should_equl_InDistributionCount_add_AppropriateCount [1ms]
! XUnitTestProject1.TitanDataTests.alreadyTooknumber_should_equl_InDistributionnumber_add_Appropriatenumber [1ms]
! XUnitTestProject1.Respostory.UserInfoRepositoryTests.test_insert_should_return_id [1ms]
! XUnitTestProject1.Respository.Bms.InBoundSkuItemRepositoryTests.querry_should_return_list [1ms]
! XUnitTestProject1.Respository.Bms.InBoundDeliveryOrderRepositoryTests.query_should_return_list [1ms]
! XUnitTestProject1.Respository.Bms.BmsJobConnectionRepositoryTests.test_query_sholud_return_null [1ms]
! XUnitTestProject1.Bms.BmsDataPullTest.inbound_order_data_pull_test [1ms]
! XUnitTestProject1.Bms.BmsDataPullTest.order_data_pull_test [1ms]
! XUnitTestProject1.Bms.BmsDataPullTest.bms_outbounddelivey_order_pull_test [1ms]
[xUnit.net 00:00:17.57] XUnitTestProject1.Respository.Bms.BmsProjectRepositoryTests.test_query_sholud_return_emtylist [SKIP]
[xUnit.net 00:00:17.57] XUnitTestProject1.Respostory.RoleInfoRepositoryTests.test_insert_should_return_id [SKIP]
[xUnit.net 00:00:17.57] XUnitTestProject1.Respository.Bms.OutBoundSkuItemRepositoryTests.query_outboundskuitem_should_return_list [SKIP]
! XUnitTestProject1.Respository.Bms.BmsProjectRepositoryTests.test_query_sholud_return_emtylist [1ms]
! XUnitTestProject1.Respostory.RoleInfoRepositoryTests.test_insert_should_return_id [1ms]
! XUnitTestProject1.Respository.Bms.OutBoundSkuItemRepositoryTests.query_outboundskuitem_should_return_list [1ms]
[xUnit.net 00:01:39.96] XUnitTestProject1.UnitTest1.TestOmsSlowQuery [SKIP]
[xUnit.net 00:01:39.98] XUnitTestProject1.UnitTest1.TestAd [SKIP]
[xUnit.net 00:01:39.98] XUnitTestProject1.UnitTest1.TestOmsAdvanceJob [SKIP]
! XUnitTestProject1.UnitTest1.TestOmsSlowQuery [1ms]
! XUnitTestProject1.UnitTest1.TestAd [1ms]
! XUnitTestProject1.UnitTest1.TestOmsAdvanceJob [1ms]
Test Run Successful.
Total tests: 25
Passed: 10
Skipped: 15
Total time: 1.7470 Minutes

Calculating coverage result...
Generating report '/builds/wlydapi/Wlyd.Titan/WLYD.Titan.Backend/XUnitTestProject1/coverage.json'
+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+

+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 100% | 100% | 100% |
+---------+------+--------+--------+
| Average | NaN% | NaN% | NaN% |
+---------+------+--------+--------+

Job succeeded

@MarcoRossignoli
Copy link
Collaborator

ok @leyou240 can you try to enable logging https://github.com/tonerdo/coverlet/blob/master/Documentation/Troubleshooting.md#coverlet-global-tool?
I've got some suspect, you could hit a know issue with test platform and maybe you need to use collectors(no .net tools)...but we can check from logs.

@MarcoRossignoli
Copy link
Collaborator

@leyou240
Copy link
Author

@MarcoRossignoli thx. This make sense, cause I use RabbitMQ to test.

@MarcoRossignoli
Copy link
Collaborator

check this #573 (comment)

@MarcoRossignoli
Copy link
Collaborator

any news?

@MarcoRossignoli
Copy link
Collaborator

Close for stale conversation(I think that the issue here is the know issue due to RabbitMQ slow shutdown), feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More details are needed
Projects
None yet
Development

No branches or pull requests

2 participants