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

Test results percentage colors are misleading. #2412

Closed
PawelWozniak opened this issue Aug 17, 2023 · 12 comments
Closed

Test results percentage colors are misleading. #2412

PawelWozniak opened this issue Aug 17, 2023 · 12 comments
Labels
feature Issue or pull request for a new feature investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@PawelWozniak
Copy link

PawelWozniak commented Aug 17, 2023

Summary

Test results colors shown in CLI are misleading as only 100% is green.

Steps To Reproduce

Run tests for classes with different coverage.

Expected result

Colors are assigned gradually.
75% and less is red as it does not meet the required coverage
76%-90% is orange as this coverage is acceptable but could be improved
91%-100% is green as it is hard to get full 100% coverage in most cases.

Actual result

Command: sfdx project deploy start --ignore-conflicts --verbose --test-level RunLocalTests --source-dir . --target-org sandbox88
Currently, everything below 100% is red.
image

System Information

PowerShell 7.3.6

sf version --verbose --json
{
  "cliVersion": "@salesforce/cli/2.4.10",
  "architecture": "win32-x64",
  "nodeVersion": "node-v18.15.0",
  "osVersion": "Windows_NT 10.0.22621",
  "shell": "cmd.exe",
  "rootPath": "C:\\Users\\u1\\AppData\\Local\\sf\\client\\2.4.10-703551c",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.6 (core)",
    "@oclif/plugin-commands 2.2.21 (core)",
    "@oclif/plugin-help 5.2.16 (core)",
    "@oclif/plugin-not-found 2.3.36 (core)",
    "@oclif/plugin-plugins 3.2.0 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.1.30 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.46 (core)",
    "@oclif/plugin-which 2.2.29 (core)",
    "@salesforce/cli 2.4.10 (core)",
    "apex 2.3.10 (core)",
    "auth 2.8.12 (core)",
    "data 2.5.5 (core)",
    "deploy-retrieve 1.17.2 (core)",
    "info 2.6.38 (core)",
    "limits 2.3.29 (core)",
    "login 1.2.25 (core)",
    "org 2.9.30 (core)",
    "schema 2.3.22 (core)",
    "settings 1.4.24 (core)",
    "sobject 0.2.2 (core)",
    "source 2.10.30 (core)",
    "telemetry 2.2.5 (core)",
    "templates 55.5.9 (core)",
    "trust 2.5.4 (core)",
    "user 2.3.28 (core)"
  ]
}

Additional information

@PawelWozniak PawelWozniak added the investigating We're actively investigating this issue label Aug 17, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions
Copy link

Hello @PawelWozniak 👋 None of the versions of sf you shared match the latest release.

Shared: 2.3.8
Latest: 2.4.10

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer validated Version information for this issue has been validated investigating We're actively investigating this issue and removed investigating We're actively investigating this issue more information required Issue requires more information or a response from the customer labels Aug 17, 2023
@AllanOricil
Copy link

AllanOricil commented Aug 18, 2023

fixed and added yellow color range
salesforcecli/plugin-source#934

when code coverage percentage <= 75 -> red
when code coverage percentage >= 90 -> green
else -> yellow

@PawelWozniak
Copy link
Author

@AllanOricil Thank you for such a quick fix.
I just have second thoughts. After reading this article https://help.salesforce.com/s/articleView?id=000385650&type=1 my understanding is that 75% is an acceptable value so it should be then in the yellow range.
Then <= 74 should be red.

@AllanOricil
Copy link

@PawelWozniak fixed

@AllanOricil
Copy link

:/

@AllanOricil
Copy link

🧓

@AllanOricil
Copy link

👴🏻

@mshanemc
Copy link
Contributor

mshanemc commented Sep 6, 2023

@AllanOricil Thanks for the PR, but we're not doing enhancements to deprecated commands in plugin-source.

This issue references project deploy start from https://github.com/salesforcecli/plugin-deploy-retrieve. You might want to look in https://github.com/salesforcecli/plugin-deploy-retrieve/blob/26769ca9d2c8fe13dbec98df496220813598f6e7/src/utils/coverage.ts#L97

@AllanOricil
Copy link

Sorry for that 😅

@mshanemc mshanemc added the feature Issue or pull request for a new feature label Sep 17, 2023
@github-actions
Copy link

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

@git2gus
Copy link

git2gus bot commented Sep 17, 2023

This issue has been linked to a new work item: W-14135617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issue or pull request for a new feature investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

4 participants