Repository navigation
feat(scripts): run test.prepare before deploy and test.cleanup after remove in live tests - #830
Merged
Merged
Conversation
…remove in live tests
8 tasks done
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.
Summary
example.jsonacceptstest.prepareandtest.cleanup, each{ "path": "<Node.js script>" }.test.cleanupneedstest.prepare.scripts/test-example.mjsruns the prepare script after install and before deploy. It runs the cleanup script after remove whenever prepare started: also after a failed step or an interruption (with its own 10-minute deadline and no signal, like remove), and in--remove-onlyruns, also when nothing was deployed. Both run withnodein the copy, withEXAMPLE_STAGE,EXAMPLE_REGIONandEXAMPLE_DIRset.preparestep: nothing is deployed and cleanup still runs. A failed cleanup is thecleanupstep when everything else passed; otherwise its error is added to the detail of the first failed step.check-pathsstatic check reports missing prepare and cleanup scripts.AGENTS.mddescribes the hooks.This is for examples that need something CloudFormation can't create before the deploy. The first one is
aws-node-customer-managed-runtime, whose runtime version needs its container image in ECR before the stack is created. Its PR builds on this branch.Test plan
npm test: 323 pass, including new runner tests for the order of steps, the hook environment, a failed prepare, a failed install, cleanup after a failed check, a failed cleanup after a pass, an interruption during prepare, and--remove-onlywith and without a deployed stack. Also new manifest and static-check tests.npm run docsandcheck-examples.mjson the first example that uses the hooks: 0 errors.Generated by Claude Code