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

Code coverage missing on Windows #770

Closed
atifaziz opened this issue Nov 20, 2020 · 2 comments · Fixed by #845
Closed

Code coverage missing on Windows #770

atifaziz opened this issue Nov 20, 2020 · 2 comments · Fixed by #845

Comments

@atifaziz
Copy link
Member

Something is off with code coverage on Windows, which is being reported blank:

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

See attached CI build log for 9dd2d5e.

On Linux/macOS builds, however, the coverage collection seems to be working fine:

+----------+--------+--------+--------+
| Module   | Line   | Branch | Method |
+----------+--------+--------+--------+
| MoreLinq | 91.18% | 89.4%  | 92.97% |
+----------+--------+--------+--------+

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total   | 91.18% | 89.4%  | 92.97% |
+---------+--------+--------+--------+
| Average | 91.18% | 89.4%  | 92.97% |
+---------+--------+--------+--------+

See attached CI build log for 9dd2d5e.

I have not traced back to when and what introduced this issue.


@atifaziz
Copy link
Member Author

Seems like this might be linked to a known issue mentioned in coverlet's repo:

6) Code coverage returns NaN%

Symptoms: You are getting following result when running Coverlet within CI/CD pipeline:

+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+

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

SUT(System Under Test) assembly is also not listed in MSBuild logs - "Instrumented module" is missing for your dll.

Solution: Check whether deterministic build is turned on for your solution, if so, follow instructions how to handle Deterministic build.

@atifaziz atifaziz linked a pull request Oct 19, 2022 that will close this issue
@atifaziz
Copy link
Member Author

Closed via 9ecd1dc that was merge of PR #845.

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

Successfully merging a pull request may close this issue.

1 participant