arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Quality Hooks

hashtag
Overview

Quality hooks are part of the git-flow process and tie in linting and unit tests to be automatically performed with each check-in by a developer.

Fortunately, the SFDX provides a number of tools for both linting, security, and unit testing to be introduced into the DevOps pipeline.

The guidance that follows illustrates how to incorporate the items into Azure Pipelines.

Static Analysis In order to ensure quality code, static analysis should performed on all source code. SonarQube and SonarCloud are great tools to help make this happen

Salesforce specific checks are provided by:

Automated Testing All unit tests should be executed for any code written. (Apex) as well as monitor code coverage with each commit

  • Apex

    • Unit Tests

      • Running as part of build: sfdx force:apex:test:run --resultformat human

Resources:

  • Salesforce DX - CI/CD -

  • Salesforce CI how-to:

Claytonarrow-up-right

Mocks linkarrow-up-right

  • Lightning

    • Linting linkarrow-up-right - ensure consistent quality code (code analysis / validation)

    • ESLint Rules linkarrow-up-right

    • Lightning Tests

  • CheckMarxarrow-up-right
    CodeScanarrow-up-right
    PMDarrow-up-right
    https://www.youtube.com/watch?v=wUc1l5keYmoarrow-up-right
    https://developer.salesforce.com/page/Continuous_Integration_How-Toarrow-up-right
    Linkarrow-up-right