Search Issue Tracker
Won't Fix
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
-
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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