Run Apex tests
Run Apex tests locally before the org round trip. Keep Salesforce as the validation gate where hosted behavior matters.
Before you start
Run from an SFDX project root. Make sure glade doctor can find the project and toolchain. Use committed fixtures for records, metadata, and mocks that the test expects.
Steps
Run the full local suite:
glade test --project .Run one class:
glade test --project . --class RefinementServiceTestRun one method:
glade test --project . --class RefinementServiceTest --method testRefinesFileRowRun tests affected by a git ref:
glade test changed --project . --since origin/mainRerun the last failures:
glade test failed --project .Write JUnit for CI:
mkdir -p reports
glade test --project . --junit reports/glade-junit.xmlExpected output
The terminal prints selected, passed, and failed test counts. A failed assertion or unsupported feature returns a non-zero exit code. JUnit output lands at the path you pass with --junit.
Common wrong turn
Do not treat a local pass as proof of every hosted side effect. Live callouts, delivered email, exact governor accounting, and hosted service engines still need Salesforce validation.