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

Generate a file hardis-report/apex-coverage-results.json with Apex code coverage details #985

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

nvuillam
Copy link
Member

@nvuillam nvuillam commented Jan 9, 2025

Related to https://github.com/orgs/hardisgroupcom/discussions/983

Sample content from a deployment command:

[
  {
    "id": "01p1n00000PPmcpAAD",
    "locationsNotCovered": [
      {
        "column": 0,
        "line": 35,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 36,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 55,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 72,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 73,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 74,
        "numExecutions": 0,
        "time": -1
      },
      {
        "column": 0,
        "line": 75,
        "numExecutions": 0,
        "time": -1
      }
    ],
    "name": "TimeSheetHandler",
    "namespace": null,
    "numLocations": 54,
    "numLocationsNotCovered": 7,
    "type": "Class",
    "dmlInfo": [],
    "methodInfo": [],
    "soqlInfo": [],
    "soslInfo": []
  },
  {
    "id": "01q1n000001de5yAAA",
    "name": "OpportuniteAfterInsert",
    "namespace": null,
    "numLocations": 2,
    "numLocationsNotCovered": 0,
    "type": "Trigger",
...

Sample content for apex run test command:

[
  {
    "id": "01p07000000CojOAAS",
    "name": "GestionNewMonthBatch",
    "totalLines": 16,
    "lines": {
      "6": 1,
      "7": 1,
      "10": 1,
      "11": 1,
      "14": 0,
      "15": 0,
      "18": 1,
      "19": 1,
      "27": 1,
      "28": 1,
      "30": 1,
      "31": 1,
      "32": 1,
      "33": 1,
      "37": 1,
      "40": 1
    },
    "totalCovered": 14,
    "coveredPercent": 88
  },
  {
    "id": "01p0Y00000OdBu1QAF",
    "name": "DAL",
    "totalLines": 36,
    "lines": {
      "7": 0,
      "8": 0,
...
  • Fix: Do not display command output if execCommand has been called with output: false

Copy link

github-actions bot commented Jan 9, 2025

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 9 0 0.08s
⚠️ BASH bash-exec 3 3 0.01s
✅ BASH shfmt 3 0 0 0.27s
✅ COPYPASTE jscpd yes no 23.41s
✅ DOCKERFILE hadolint 1 0 0.15s
✅ JSON npm-package-json-lint yes no 0.54s
⚠️ JSON prettier 26 0 1 0.71s
✅ JSON v8r 26 0 36.53s
⚠️ MARKDOWN markdownlint 293 0 338 9.49s
✅ MARKDOWN markdown-table-formatter 293 0 0 1.55s
✅ REPOSITORY checkov yes no 20.13s
⚠️ REPOSITORY gitleaks yes 3 45.56s
⚠️ REPOSITORY grype yes 6 8.89s
✅ REPOSITORY trivy yes no 5.34s
✅ REPOSITORY trivy-sbom yes no 0.42s
✅ REPOSITORY trufflehog yes no 6.86s
✅ SPELL cspell 546 0 11.79s
⚠️ SPELL lychee 336 15 2.31s
✅ TYPESCRIPT eslint 191 0 0 10.5s
⚠️ TYPESCRIPT prettier 191 0 1 0.58s
✅ XML xmllint 4 0 0 0.29s
⚠️ YAML prettier 15 0 1 0.54s
✅ YAML v8r 15 0 11.14s
✅ YAML yamllint 15 0 0.81s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

…de coverage details

- Generate a file **hardis-report/apex-coverage-results.json** with Apex code coverage details for the following commands:
  - [hardis:project:deploy:smart](https://sfdx-hardis.cloudity.com/hardis/project/deploy/smart/) (only if `COVERAGE_FORMATTER_JSON=true` environment varriable is defined)
  - [hardis:org:test:apex](https://sfdx-hardis.cloudity.com/hardis/org/test/apex/) (always)
  - [SF Cli deployment wrapper commands](https://sfdx-hardis.cloudity.com/salesforce-deployment-assistant-setup/#using-custom-cicd-pipeline)
@nvuillam nvuillam force-pushed the features/coverage-format branch from 0d602c4 to 32d4b43 Compare January 9, 2025 22:15
@nvuillam nvuillam merged commit 29a8dda into main Jan 9, 2025
13 checks passed
@nvuillam nvuillam deleted the features/coverage-format branch January 9, 2025 22: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.

1 participant