Skip to main content

Allow module test cases in .spacelift/config.yml to be conditional on the PR target branch

Summary
Add a way to run or skip individual test cases in .spacelift/config.yml depending on the target (base) branch of a pull request. For example, PRs into develop run a smoke subset and PRs into main or release/* run the full suite.

Current behavior

  • Test cases are a static tests: list. Every test runs for every module test run.

  • Per-test config is limited to settings like environment and hooks.

  • Push policies can choose track, propose or ignore per PR event. They cannot select which test cases run.

Proposed solution
Add an optional condition key on test cases:

tests:
  - name: smoke
  - name: full_integration
    run_on:
      target_branches: ["main"]
  - name: migration
    skip_on:
      target_branches: ["develop"]
Workaround
Problem

Log in to comment and vote

No comments yet

Be the first to share your thoughts.