feat(tests): add automated test suite with 187 bats-core tests#16
Open
jpelaez-23blocks wants to merge 3 commits intomainfrom
Open
feat(tests): add automated test suite with 187 bats-core tests#16jpelaez-23blocks wants to merge 3 commits intomainfrom
jpelaez-23blocks wants to merge 3 commits intomainfrom
Conversation
Adds comprehensive test coverage for the claude-plugin CLI tools using bats-core, catching the 3 shipped production bugs from PRs #14 and #15: - Missing /v1/ prefix in fetch URLs (PR #14) - Millisecond vs seconds timestamps in message IDs (PR #14) - Filesystem delivery without config.json guard (PR #15) Includes: - 140 unit tests covering helpers (address, message ID, routing, signing, storage, sanitize, attachments) and security (injection, trust, wrapping) - 47 integration tests covering send routing, fetch URLs, local send, init flow, register flow, and inbox/read/delete lifecycle - Shared test_helper.bash with env isolation, fixture helpers, curl mocking - GitHub Actions CI workflow running on every PR and push to main - npm-based test runner with bats-core, bats-assert, bats-support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split CI into parallel ShellCheck + Tests jobs, add path filtering to
skip runs on doc-only changes, add concurrency groups to cancel stale
runs, and tighten timeouts. Fix SC2115 in amp-delete.sh (rm -rf guard).
- Add .shellcheckrc with baseline exclusions (SC2155, SC1090/91, SC2034)
- Replace single-job workflow with parallel lint + test jobs
- Add concurrency group (ci-${{ github.ref }}) with cancel-in-progress
- Add path filters for scripts/, tests/, package files, workflow
- Reduce timeouts: 3min lint, 5min tests (was 10min single job)
- Fix rm -rf to use ${var:?} guard against empty variable expansion
- Add npm lint script for local shellcheck runs
Co-authored-by: Juan Pelaez <juan.pelaez@3metas.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Assigns @jpelaez-23blocks as code owner for all files, with explicit entries for scripts/, tests/, and .github/ to ensure CI and core code changes always require owner review. Co-authored-by: Juan Pelaez <juan.pelaez@3metas.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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
What's Covered
Unit tests (140): address parsing, message ID format, routing decisions, Ed25519 signing/verification, inbox/sent storage with replay protection, filename sanitization, attachment handling, injection detection (6 categories), trust level determination, content security wrapping
Integration tests (47): send routing (filesystem vs API), fetch URL construction with
/v1/prefix, local send end-to-end, init flow, register flow, inbox/read/delete lifecycleRegression guards:
config.json(not just directory existence)/v1/prefixInfrastructure
tests/test_helper.bash— shared setup with env isolation ($BATS_TEST_TMPDIR), fixture helpers, PATH-based curl mockingpackage.json— npm devDependencies for bats-core, bats-assert, bats-supportrun_tests.sh— local test runner (./run_tests.sh unit|integration|all).github/workflows/tests.yml— CI workflow with 10min timeoutTest plan
./run_tests.sh all)/v1/prefix →fetch_urls.batsfailsconfig.jsoncheck →send_routing.batsfails🤖 Generated with Claude Code