Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

orchestrator validate step getting different code coverage from the same ci pool #836

Closed
ypan0 opened this issue Feb 8, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ypan0
Copy link

ypan0 commented Feb 8, 2022

Hello everyone,

I'm running into an issue where on pipeline, same code, same type of scratch org in the same pool, keeps getting different code coverage, and diff a lot, also usually if I run validate locally, I can get 80%~85% in the same pool.
This is a unlocked package
@dxatscale/sfpowerscripts 10.2.6 (10.2.6)
sfdmu 4.12.7
sfpowerkit 4.0.3

node v12.22.3

image
image

any solution for this one?
Thank you

@ypan0
Copy link
Author

ypan0 commented Feb 8, 2022

image
looks like it's 79% on the third run

@dieffrei
Copy link
Contributor

dieffrei commented Feb 9, 2022

We have the same issue, even having specific unit tests for each class in a package, the code coverage is not calculated.
I also checked the code coverage result from salesforce, and it seems salesforce doesn't take into consideration or skip some test

@azlam-abdulsalam
Copy link
Contributor

We are looking into this, the possible hypothesis is compilation is not finished due to delay at salesforce end, so tests is skipping those classes.

@dieffrei
Copy link
Contributor

dieffrei commented Feb 9, 2022

@azlam-abdulsalam I agree, since yesterday when I was investigating I saw that some classes didn't get code coverage due to "compilation in progress" status

@azlam-abdulsalam azlam-abdulsalam added analysis To be decided on how to solution/fix and removed hotfix labels Feb 10, 2022
@azlam-abdulsalam azlam-abdulsalam added the bug Something isn't working label Feb 26, 2022
azlam-abdulsalam added a commit that referenced this issue Mar 1, 2022
…est per package (#869)

* fix(apextests): switch to synchronous testing while triggering apex test per package

re #836

* [CodeFactor] Apply fixes

Co-authored-by: codefactor-io <[email protected]>
azlam-abdulsalam pushed a commit that referenced this issue Mar 1, 2022
…any trigger

re #836  Attempt a cleanup to see any potential improvement
azlam-abdulsalam added a commit that referenced this issue Mar 1, 2022
…test execution (#871)

* fix(apex-tests): clear code coverage and existing test result before any trigger

re #836  Attempt a cleanup to see any potential improvement

* Add test for chunkArray utility function

* fix(clear-coverage): Fix Review comments

Co-authored-by: Alan Ly <[email protected]>
@azlam-abdulsalam
Copy link
Contributor

@ypan0 @dieffrei Initial analysis is pointing to the fact this happens only during parallel testing, as code coverage is getting skipped for classes as it being recompiled in parallel
image

We have disabled parallel testing in some orgs and it seems to be working better. Monitoring this issue

@azlam-abdulsalam azlam-abdulsalam linked a pull request Mar 5, 2022 that will close this issue
8 tasks
@azlam-abdulsalam azlam-abdulsalam removed the analysis To be decided on how to solution/fix label Mar 21, 2022
@azlam-abdulsalam
Copy link
Contributor

azlam-abdulsalam commented Mar 24, 2022

This has been fixed in alpha and will be part of the next release. All these test classes that fail to contribute to coverage will be retriggered in serial mode and the test results will be converged for code coverage calculation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants