A team develops an order processing pipeline in Azure Databricks. The test suite has many unit tests that finish in milliseconds, integration tests that finish in seconds, and one end-to-end test that runs the complete daily workflow and takes about 45 minutes.
Requirements:
- Developers must receive test results within five minutes of every code change.
- Production deployments can happen at any time of day, and each deployment must be preceded by a passing end-to-end run of the code being deployed.
- All tests must run automatically, without manual steps by business users.
How should the team schedule the tests?
Unit and integration tests run in milliseconds to seconds, so they can give feedback on every code change. The 45-minute end-to-end test should not run on every change. Because deployments can happen at any time, an off-peak schedule cannot guarantee a passing run before each deployment. Running the end-to-end test in an automated Databricks job as part of the deployment pipeline meets all three requirements.
- Correct: Run unit and integration tests on every code change, and run the end-to-end test in a Databricks job that executes before each production deployment. The fast unit and integration tests give quick feedback on each change. Running the slow end-to-end test in an automated job within the deployment pipeline means it gates every production deployment.
- Not correct: Run unit and integration tests on every code change, and run the end-to-end test nightly during off-peak hours. Off-peak scheduling is valid in general. However, a nightly run is not tied to deployments that can happen at any time, so code could reach production before its end-to-end run.
- Not correct: Run unit and integration tests on every code change, and replace the end-to-end test with stakeholder UAT before each deployment. UAT is stakeholders validating business requirements, which adds manual steps by business users. It also does not replace the automated end-to-end test of the full pipeline.
- Not correct: Run unit, integration, and end-to-end tests together on every code change. The end-to-end test takes about 45 minutes. The guidance is to run end-to-end tests off-peak or in the deployment pipeline, not on every code change, so feedback would be too slow.