Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save simbo1905/b1e168cbc637cd0ed3fa5f6b0f6ee99f to your computer and use it in GitHub Desktop.

Select an option

Save simbo1905/b1e168cbc637cd0ed3fa5f6b0f6ee99f to your computer and use it in GitHub Desktop.
guard_your_tests_with_fast_runtime_deps_smokes

Guard your tests with fast runtime dependency smokes

When a test suite depends on runtime or deploy-time primitives, add a tiny fail-fast smoke before the expensive test work starts.

This keeps the error local and obvious. Instead of getting a confusing failure deep inside a build, unit runner, or end-to-end harness, the command stops immediately with a message that points back to bootstrap.

Good candidates for the smoke are:

  • database client availability
  • object-store client availability
  • cryptographic runtime libraries
  • system CLIs used by the harness

Keep the check short and explicit:

  1. verify the dependency can be loaded or executed;
  2. fail with a message that tells the user to try the bootstrap command;
  3. avoid duplicating the full build/test path.

The purpose is not to replace tests. It is to make missing prerequisites fail fast, in the right place, with the right hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment