FlexDeploy is an Enterprise DevOps platform with fully integrated support for Salesforce apps, metadata customizations, integrations, and more. This is the last article in a blog series that will help you understand what makes FlexDeploy a perfect choice to implement DevOps, CI/CD, and release automation with Salesforce.
Here is a summary of the FlexDeploy Loves Salesforce series.
- FlexDeploy Loves Salesforce: DevOps for Salesforce
- FlexDeploy Loves Salesforce: Source Control Your Salesforce Changes
- FlexDeploy Loves Salesforce: Deploy Salesforce Apps and Metadata Objects
- FlexDeploy Loves Salesforce: Build and Deploy Salesforce DX Apps
- FlexDeploy Loves Salesforce: Unit Test and Test Automation for Your Salesforce
FlexDeploy’s extensive set of features for Salesforce and Test automation with test plugins:
- Ensure that Salesforce changes work as expected.
- Provide a suite of regression tests that can be rerun every time so you don’t break existing functionality.
- Meet code coverage requirements as per your preset thresholds.
- Ensure high-quality deployment to production and happy business users.
The Apex testing framework enables you to write and execute tests for your Apex classes and triggers. Apex unit tests ensure high quality for your Apex code and let you meet the requirements for deploying Apex. You can configure your test levels at the package level and ensure that tests are executed during deployment.
Apex tests will be executed as part of the deploy or validate package and results will be captured. You can view the results in FlexDeploy and also automate deployment promotions based on test results, ensuring your package will get promoted to the next environment only if you have successful results. Users can be confident the required unit tests are executed and have visibility on what got executed.
Define code coverage thresholds in FlexDeploy. For example, you can stipulate that at least 75% of Apex code must be covered, and all those tests must pass. From your Apex Test, the code coverage percentage will return as output. You can look at those results for manual approval or define a gate in your pipeline to act upon. FlexDeploy will notify the developer/team to work on the unit tests to increase the coverage.
Static Code Analysis
Along with Unit testing, most of our customers use static code analysis tools like PMD and SonarQube to increase the quality of the code. These tools help find Bugs, Security Vulnerabilities, and Code Smells. FlexDeploy has support for both of these tools, and you can automate the executions after pulling the code from your Org or before deploying. You can view the results in FlexDeploy and also take automated actions based on the results.
This analysis is normally done after pulling the Apex code from a Salesforce Org or Source Control (like Git). You could also configure your workflow to re-run the analysis before approving the deployment to each environment.
FlexDeploy will execute the analysis based on your custom rule file if you have one. Otherwise, it uses the default rules. You can view reports in FlexDeploy for manual approvals or you can configure to fail or auto promote the package based on the results.
Based on the priority, any issues get a separate report file to view and/or download.
FlexDeploy’s full-grown Test Automation framework can be utilized to configure what tests run in each environment. Test automation tools like Selenium, Tosca, HP UFT, and Automation Anywhere can be used to execute tests. Simply configure FlexDeploy to execute the tests and automate the code promotions based on the test results.
FlexDeploy has a robust pipeline and release automation system. With that, all the results from the same environment or any of the previous environments can be verified prior to promoting the changes.
FlexDeploy provides many capabilities in Test and Code review to achieve high-quality Salesforce deployments. But you don’t need to have all of it on day one. You can mature the process as you go with simple configurations.