Skip to content

fix(test): stop awsSsm tests from starting the real aws CLI - #401

Merged
cvince merged 2 commits into
mainfrom
fix/aws-ssm-detect-test-stub
Nov 9, 2026
Merged

cvince merged 2 commits into
mainfrom
fix/aws-ssm-detect-test-stub

Conversation

@cvince

@cvince cvince commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

CI on main is red. The awsSsm detect tests started the real aws CLI to look up the region. On CI runners it can take more than 5 s to start, so the tests hit the timeout. One deploy test could also reach AWS.

What

  • tests/deploy/awsSsm.test.ts: puts a stub aws first on PATH for the whole file. It answers configure get region with stub-region-1 and fails every other command at once. The HAS_AWS gate is gone, so the preflight happy-path test always runs.
  • New test: detect uses the region from the stub, which proves the real aws is never started.
  • src/deploy/adapters/awsSsm.ts: passes env: process.env to spawnSync/spawn. Bun ignores PATH changes made at runtime unless env is passed explicitly. Node behaves the same either way.

Checks

…e real one

The detect tests started the real aws CLI for the default region. On
GitHub runners that can take more than 5 s, so the tests timed out on
main. They now put a stub aws first on PATH, and a new test checks the
region comes from the stub. detectAwsRegion passes env explicitly,
because Bun only looks up the current PATH when env is given.
…eal aws CLI

The deploy test for a partially-missing var set went on to real aws calls
and timed out on CI too. The stub now covers the whole file and fails
every command except configure, and which() and spawnAsync pass env so
Bun looks up the stub. The happy-path preflight test no longer needs
the real aws on PATH, so it always runs.
@cvince
cvince merged commit b6e4fff into main Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant