dxatscale/sfpowerscripts

apextests:trigger --validatepackagecoverage Reports error when overall package coverage is sufficient

Closed this issue · 1 comments

mpaul1 commented

Describe the bug
Running sfp apextests:trigger -u -l RunAllTestsInPackage -n Core --validatepackagecoverage
Fails due to "Error: There are classes that do not satisfy the minimum code coverage of 75%"; even though the overall
package coverage is greater than 75%

=== Test Summary

Name Value
outcome Passed
testsRan 1013
passing 1013
failing
skipped
passRate 100%
failRate 0%
testStartTime Fri Jan 19 2024 3:01:30 AM
testExecutionTime 2729035 ms
testTotalTime 2729035 ms
commandTime 417 ms
hostname https://xxxxxxxx.my.salesforce.com/
orgId xxxxxxxxx
username name@email.com
testRunId 707PV00000AUFJz_707PV00000AUji2
userId 0050z0000083yrNAAQ
packageCoverage 78

Error: There are classes that do not satisfy the minimum code coverage of 75%

sfdx-project config:
"path": "src/Core",
"default": true,
"package": "Core",
"versionNumber": "1.0.68.NEXT",
"type": "source",
"isOptimizedDeployment": false,

Expected behavior
I would expect there would be no error since overall package code coverage was greater than 75%. A warning or informational note would be fine.

Platform Details (please complete the following information):

  • OS: Linux
  • SFP Version: @dxatscale/sfpowerscripts/25.5.3 linux-x64 node-v18.19.0
  • Salesforce CLI(sf cli) Version: @salesforce/cli/2.23.20 linux-x64 node-v18.19.0

Azure Devops Agent Config:
Starting: Initialize job
Agent name: 'linux-release-agent-5d964f6dbf-7tncc'
Agent machine name: 'linux-release-agent-5d964f6dbf-7tncc'
Current agent version: '2.181.2'
Agent running as: 'root'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: NodeTool (0.179.1)
Downloading task: CmdLine (2.178.0)
Downloading task: Bash (3.179.0)
Downloading task: PublishTestResults (2.171.0)
Checking job knob settings.
Finished checking job knob settings.
Start tracking orphan process

@mpaul1 test coverage is validated individually for each class in the case of source packages

Please check here

https://docs.dxatscale.io/sfpowerscripts/types-of-packaging