Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warn when code coverage doesn't meet requirement #656

Merged
merged 4 commits into from
Jun 8, 2023

Conversation

WillieRuemmele
Copy link
Contributor

What does this PR do?

warns the user when the deployment doesn't meet the required code coverage

before

 ➜  sf project deploy validate --source-dir force-app/main/default --test-level RunAllTestsInOrg          
Validating Deployment of v57.0 metadata to [email protected] using the v57.0 SOAP API.
Deploy ID: 0Af5300000e2PMyCAM
Status: Failed | ████████████████████████████████████████ | 87/87 Components

Test Results Summary
Passing: 0
Failing: 0
Total: 0
Error (1): Failed to validate the deployment (0Af5300000e2PMyCAM).

after

 ➜  sf project:deploy:validate --source-dir force-app --test-level RunAllTestsInOrg
Validating Deployment of v57.0 metadata to [email protected] using the v57.0 SOAP API.
Deploy ID: 0Af5300000e2RDiCAM
Status: Failed | ████████████████████████████████████████ | 89/89 Components

Test Results Summary
Passing: 1
Failing: 0
Total: 1
Time: 421
 ›   Warning: Average test coverage across all Apex Classes and Triggers is 25%, at least 75% test coverage is required.
Error (1): Failed to validate the deployment (0Af5300000e2RDiCAM).

this is also printed on other deploy commands

 ➜  sf project deploy start --source-dir force-app --test-level RunAllTestsInOrg 
Deploying v57.0 metadata to [email protected] using the v57.0 SOAP API.
Deploy ID: 0Af5300000e2SL9CAM
Status: Failed | ████████████████████████████████████████ | 89/89 Components

Test Results Summary
Passing: 1
Failing: 0
Total: 1
Time: 339
 ›   Warning: Average test coverage across all Apex Classes and Triggers is 25%, at least 75% test coverage is required.

What issues does this PR fix or reference?

@W-13546168@
forcedotcom/cli#2179

@shetzel shetzel merged commit beb7fcb into main Jun 8, 2023
@shetzel shetzel deleted the wr/failToValidateDeployError branch June 8, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants