Repository navigation
fix(test): stop awsSsm tests from starting the real aws CLI - #401
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on main is red. The
awsSsmdetect tests started the realawsCLI 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 stubawsfirst on PATH for the whole file. It answersconfigure get regionwithstub-region-1and fails every other command at once. TheHAS_AWSgate is gone, so the preflight happy-path test always runs.awsis never started.src/deploy/adapters/awsSsm.ts: passesenv: process.envtospawnSync/spawn. Bun ignores PATH changes made at runtime unless env is passed explicitly. Node behaves the same either way.Checks
tests/deploy/awsSsm.test.ts: 21 passtests/deploy: 733 pass