Merged
Conversation
- Add 60 bats unit tests covering all testable shell scripts: - options_helpers.sh (has_argument, extract_argument) - aws_unset.sh (clears all 4 AWS credential env vars) - configure_pip.sh (pip config calls for each env var) - promote_image.sh (all 11 required env var validations) - update_ecs.sh (--help, AWS CLI invocation, failure path) - update_lambda.sh (--help, AWS CLI invocation, failure path) - Add mock helpers for aws, pip, docker, tput - Add .github/workflows/test-shell-scripts.yml CI workflow - Add documentation/ folder with full reference docs for all 10 actions All 60 tests pass locally.
- Remove redundant action docs (each action already has its own README.md) - Move LINTING.md → documentation/LINTING.md - Add documentation/TESTING.md with full testing guide - Update README.md links to point to new paths
- tests/README.md: add language specifier to fenced code block (MD040) - tests/README.md: wrap long lines to stay within 180-char limit (MD013) - test-shell-scripts.yml: use sudo for npm install -g on Ubuntu runner (EACCES)
…ity.yml
- Move flat tests/unit/*.bats into per-action subdirectories (tests/unit/<action-name>/)
mirroring the mono-repo structure of the actions themselves
- Update BATS_TEST_DIRNAME depth from ../.. to ../../.. in all test files
- Delete .github/workflows/test-shell-scripts.yml
- Rewrite code-quality.yml with two jobs:
- lint-markdown: runs markdownlint when .md files change (unchanged behaviour)
- bats-tests: matrix job using tj-actions/changed-files to run tests only for
the specific action(s) that changed, each in an isolated job
- Update tests/README.md and documentation/TESTING.md to reflect new structure
…steps Replaces the detect-changes + lint-markdown + bats-tests (matrix) pattern with a single 'quality' job. Per-action test steps use tj-actions/changed-files output with contains() checks rather than a matrix — sequential execution in one runner is more efficient for fast-running bats suites where job startup overhead outweighs any parallelism benefit.
jonryser
approved these changes
Mar 12, 2026
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
Adds 60 bats unit tests and a
documentation/folder covering all 10 actions in this repo.Tests (
tests/)Uses bats-core to unit test the bash scripts that power the actions. All 60 tests pass.
options_helpers.batshas_argument()andextract_argument()parsing logicaws_unset.batsconfigure_pip.batspip config setcalls per env var; no-op when unset;--helppromote_image.bats--helpupdate_ecs.bats--help,aws ecs update-serviceinvocation,--force-new-deployment, failure pathupdate_lambda.bats--help,aws lambda update-function-codeinvocation, failure pathStrategy: External commands (
aws,pip,tput) are replaced with lightweight mock binaries that record every call to a log file. Tests assert the correct arguments were passed without hitting real cloud APIs.CI workflow
.github/workflows/test-shell-scripts.ymlruns the full suite on every push/PR touchingtests/or any.shfile under.github/actions/.Documentation (
documentation/)Full reference docs for all 10 actions — inputs, outputs, usage examples, how-it-works descriptions, required IAM permissions, and dependency notes.
documentation/README.md— index with summary tabledocumentation/actions/configure-aws.mddocumentation/actions/job-info.md(includes branch→env and tag→env mapping tables)documentation/actions/lint-sql.mddocumentation/actions/lint-terraform.mddocumentation/actions/lint-test-yarn.mddocumentation/actions/promote-ecr-image.md(same-account vs cross-account flows)documentation/actions/test-python.mddocumentation/actions/update-aws-ecs.mddocumentation/actions/update-aws-lambda.mddocumentation/actions/validate-terraform.mdWhat can't be unit tested
The composite action
.ymlfiles use GitHub Actions expression syntax (${{ inputs.xxx }}) that only resolves inside an actual runner. Testing those requires integration tests running in GitHub Actions itself — that's a natural next step if desired.