Repository navigation
fix(readiness): calculate Flow coverage the way Salesforce does - #59
Conversation
Salesforce also counts the latest inactive versions that have a test, so readiness could report less coverage than Salesforce uses. readiness now applies Salesforce's formula for the headline, ready, and Flows needed, shows the active-only figure when they differ, says when it assumed the 75% threshold that production can set, and notes that element coverage does not count.
|
Added a README note from the Tooling API |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
🧬 Mutation Testing Results
🟢 Score: 91.03% | ✅ Killed: 538 | Per-file breakdown
|
What
sf flowcov readinessnow calculates Flow coverage the way Salesforce does for "Deploy processes and flows as active".readinesscounted only active versions, so it could report less coverage than Salesforce uses. It was never more.OrgCoverageSource.countCoveredInactiveVersions()counts the latest inactive versions of counted Flows that have coverage.ready, andflowsNeedednow go by Salesforce's number. The JSON addssalesforceCoveragePercentandcoveredInactiveVersions.--thresholdisn't passed, the report uses 75% and says so (thresholdAssumedin JSON). The flag help explains where to find the real value.Why
readinessbefore this change.Sources
FlowTestCoveragedocs describe the calculation more loosely: covered Flows divided by active processes and autolaunched Flows. Taken literally, that can exceed 100% when inactive versions have coverage, so this PR follows the help article. Both sources count coverage on inactive versions as covered.Testing
npm run build,npm run testandnpm run lint:dependenciespass. Branch coverage is 98.76%.countCoveredInactiveVersions, the help article's example (90.9%), the assumed threshold, and the output wording.readinessagainst a scratch org: with no covered inactive versions, the output keeps the one-line form and adds the threshold and element coverage notes.