Search Issue Tracker
Won't Fix
Won't Fix in 2023.2.X
Votes
16
Found in
2021.3.4f1
2023.2.0a1
Issue ID
UUM-15006
Regression
No
Coverage.GetStatsFor API shows 0 hits for generic methods
Steps to reproduce:
- Open attached project
- Enable Code Coverage by pressing Test/Toggle
- Open Test Runner and run all editor tests
- Click Test/Cov to print coverage results
Actual result: Notice that hitCount for lines 26, 27 and 28 is 0
Using Coverage.GetStatsForAllCoveredMethods instead of Coverage.GetStatsFor will return correct hitCount. Open TestGenerics.cs, comment line 15 and uncomment line 16. Redo repro steps. Notice that now hitCount on lines 26, 27 and 28 is 1.
Reproduced with: 2021.3.4f1
Comments (6)
-
JuliusJ
Mar 27, 2023 13:11
This issue is for the Code Coverage API and not the Code Coverage package.
There was a regression in the Code Coverage package which caused a similar issue. It was fixed in version 1.2.3 of the package and can be tracked here:
https://issuetracker.unity3d.com/issues/coverage-package-fails-to-gather-any-coverage-for-generic-methods -
SpectaluarTree
Feb 28, 2023 01:33
The issue seems to appear on package version "1.2.2", but not on "1.1.1".
As a temporary solution we can use the older version -
yilin-li
Feb 02, 2023 07:39
Reproduced on version 2021.3.17f1
-
brunobiluca
Jan 16, 2023 18:14
Reproduced on version 2021.3.16f1
-
nic_mothandflame
Jan 14, 2023 00:16
Reproduced on version 2020.3.39f1
-
willykc
Oct 27, 2022 17:32
Reproduced on version 2020.3.33
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Different text alignment in the column header in Entities "System" window
- Objects with Universal Render Pipeline/Particles/Lit shader are always lit up when changing their Rendering Layer Mask
Resolution Note:
Fixed in the Code Coverage package. See issue COV-17 at https://issuetracker.unity3d.com/issues/coverage-package-fails-to-gather-any-coverage-for-generic-methods
Resolution Note (2023.2.X):
Fixed in the Code Coverage package. See issue COV-17 at https://issuetracker.unity3d.com/issues/coverage-package-fails-to-gather-any-coverage-for-generic-methods