Sub topic 3
Automating Release Regression Tests
Assume you understand Setup, sandboxes, Flow, Apex, and the difference between production and sandbox orgs. Basic command-line knowledge helps with the Salesforce CLI.
Automating release regression tests
Run the same tests against a preview sandbox before production upgrades. Store test results so the team can compare failures with the previous release.
A CI job can run local Apex tests after authenticating to a test org:
#!/usr/bin/env bash
set -euo pipefail
TARGET_ORG="${TARGET_ORG:?Set TARGET_ORG to a sandbox alias or username}"
mkdir -p test-results
sf apex run test \
--target-org "$TARGET_ORG" \
--test-level RunLocalTests \
--result-format junit \
--output-dir test-results \
--wait 20Add API tests for important integrations and browser tests for key user journeys, such as creating an opportunity or submitting a case. Keep test data isolated and use service accounts with only the permissions required by the tests.
Trust status and maintenance windows
Check Salesforce Trust before testing and before the production upgrade. Trust shows service incidents, maintenance windows, and instance-specific notices. Record the planned window in the release plan. Avoid scheduling deployments, data loads, or user training during that period.
Communicating changes and enabling users
Tell admins, developers, support staff, and end users what changes, when the upgrade occurs, and where to report problems. Link to relevant release notes and explain visible changes in plain language. Give support staff a short troubleshooting guide and identify an escalation owner.
Building a release-readiness checklist
Use one checklist with an owner and evidence for each item.
| Area | Evidence of readiness |
|---|---|
| Automation | Apex, Flow, API, and user journey tests pass |
| Integrations | Authentication and request samples succeed |
| Communication | User notice and support instructions are published |
| Recovery | Rollback or mitigation steps are documented |
Review Release Updates and enforcement dates separately. A feature that is optional today may require configuration or code changes before enforcement.
Monitoring and triage after the upgrade
Monitor login errors, Flow failures, Apex exceptions, integration queues, and key business transactions. Compare error rates with the pre-upgrade baseline. For each regression, capture the user, record, timestamp, release version, and reproduction steps. Classify the issue as configuration, permission, code, data, or Salesforce service behavior, then assign an owner and mitigation.
Exercise
What should a CI release test do when one Apex test fails?
Show answer
Fail the release check, preserve the test output, and send the failure to the owner for triage before approving the upgrade.