Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Metrics Not Being Computed
CoolBreeze
#1 Posted : Tuesday, November 10, 2020 7:59:55 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
I have several VB class libraries. For each library I had a test project with test files.
Everything worked just fine. NCrunch discovered and ran the tests, computed
Metrics. I saw the metrics in the NCrunch Metrics window.

For better or worse, I was asked to copy the class libraries and test files
into a new project (not what I wanted to do since now I have two sets of
code...)

However, in the new project the Metrics for all main code files shows as 0.00%.


Metrics for the test files in the Tests project range from 33.73% to 100%
(as expected).

A few things I did to reset the environment:


  • In the old project I set NCrunch to run tests manually.

    In the new project I set NCrunch to run automatically.

    In the new project I changed NCrunch to run tests manually.

    Metrics for the main code still shows 0.00%.

  • I disabled and enabled NCrunch.

    Metrics for the main code still shows 0.00%.

  • I restarted VS 2019.

    Metrics for the main code still shows 0.00%.



Visual Studio 2019.
NCrunch 4.4.0.12
NUnit 3.12.0
ASP.NET Framework 4.7.2


Remco
#2 Posted : Tuesday, November 10, 2020 11:47:41 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue. A few questions to try and figure out what is going on:

- On the projects missing metrics, do you still have coverage markers?
- If so, are the coverage markers aligned with the metrics being aggregated?
- Does the metrics window still show the correct number of lines and other metrics?
CoolBreeze
#3 Posted : Wednesday, November 18, 2020 8:00:05 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Hi Remco,

re: - On the projects missing metrics, do you still have coverage markers?
All code lines have black coverage markers.

re: - If so, are the coverage markers aligned with the metrics being aggregated?
I don't understand your question.

re: - Does the metrics window still show the correct number of lines and other metrics?
I wanted to add a screenshot of the Metrics window but couldn't figure out
how to do that.

So here's some stats for one of the code files:
Code Coverage %: 0.00%
Compiled Lines: 45
Covered Lines: 0
Code Lines: 45
Excluded Line: 0
Uncovered Lines: 45

I wondered if I had put in a: ' NCrunch: start no code coverage.
but didn't close it with a: 'NCrunch end no code coverage.

I don't have any start\end code coverage statements
in my class library.
Remco
#4 Posted : Wednesday, November 18, 2020 10:44:43 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for the extra details. It looks like this is a missing code coverage issue. Can you check if any of the suggestions on this documentation page work for you?
CoolBreeze
#5 Posted : Thursday, November 19, 2020 4:48:23 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
The problem was "Lost Project References".

Once I updated the references to use Project references
I now see the code coverage markers as expected.

Thanks!

Ed


1 user thanked CoolBreeze for this useful post.
Remco on 11/19/2020(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download