Courts CI must apply a schema migration before integration tests that query the new tables. How should the workflow be ordered?
Select an answer to reveal the explanation.
Short Explanation
You’ll want the schema migration to finish before tests query the new tables—like pouring the courthouse foundation before scheduling the inspection. Ordering keeps tests from tripping over tables that haven’t appeared yet.
Full Explanation
Sequential dependencies require ordered jobs when later stages depend on earlier side effects. Courts CI that must query new tables should run the schema migration job first, then run integration tests that depend on the migrated schema. This ordering works because integration tests assume a specific database shape; if migrations have not completed, tests may fail with missing-relation errors that look like application bugs, or pass against an outdated schema and miss regressions. Starting integration tests while the migration job is still running fails because the race produces nondeterministic results—sometimes green, sometimes red—undermining trust in Courts CI as a gate. Skipping migrations in CI and hoping production already matches every branch fails because branches can introduce schema changes that production does not yet have; CI must apply migrations in an ephemeral or dedicated test database to validate the branch. Deleting the test stage whenever a migration file appears in the pull request also fails: migrations are exactly when schema-sensitive tests matter most, so removing the tests drops the safety net when risk is highest. Exam caveat: “migrate then test” still requires isolation; prefer ephemeral databases or transactional fixtures so parallel Courts pipelines do not corrupt each other’s schema state. Practical check: declare an explicit dependency from integration tests to the migration job, add a deliberate migration that creates a table the tests require, and confirm tests fail if the dependency is removed and pass when ordering is restored.