SFDX Unlocked Packages Guide
  • Project Overview
  • Lifecycle Guidance
    • Development Models
    • Team Sprint Collaboration
    • Git Strategy
    • Development Guidance
    • Testing Guidance
    • Agile/DevOps shift-left testing
    • Code Promotion
  • Salesforce DX & CI/CD
    • Quality Hooks
  • Supporting Infrastructure & Environments
    • Environment Types
      • Scratch Org Guidance
      • Sandbox Guidance
      • Handling Secure Data
  • Opinionated Guide
    • Introduction
  • Developer Resources
    • SFDX Package Development
      • Introduction
      • Creating Unlocked Packages
        • Package Errors
      • Project Structure
    • Pipeline Introduction
    • Developer Machine Setup
      • VS Code Configuration
      • Creating the SFDX Project
    • Extras
      • SonarCloud / SonarLint
      • Code Review Checklist
      • Additional External Resources
    • Untitled
  • Running the Org
    • Team Responsibilites
    • Onboarding Resources
  • Journey to Unlocked Packages
    • Introduction
    • Getting Ready for Source Driven Development
    • Moving from Unmanaged to Unlocked
    • Unlocked Guidance
  • Test Automation
    • Manage Test Data
    • UI Test Automation - POM Framework
    • Agile/DevOps Shift-left Testing
    • Selenium Extent Reports - Dotnet Core
    • Dotnet Core Selenium Tests on Azure-devops-pipeline
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Salesforce DX & CI/CD

Quality Hooks

PreviousCode PromotionNextEnvironment Types

Last updated 6 years ago

Was this helpful?

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

      • Mocks

    • Lightning

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

      • ESLint Rules

      • Lightning Tests

Resources:

Salesforce DX - CI/CD -

Salesforce CI how-to:

CheckMarx
CodeScan
PMD
Clayton
link
link
link
Link
https://www.youtube.com/watch?v=wUc1l5keYmo
https://developer.salesforce.com/page/Continuous_Integration_How-To