Skip to content

feat: improve testing framework and add CI - #48

Merged
simonmysun merged 6 commits into
mainfrom
feat/test-improvements
Jul 24, 2026
Merged

simonmysun merged 6 commits into
mainfrom
feat/test-improvements

Conversation

@simonmysun

@simonmysun simonmysun commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Resolves #33

Copilot AI review requested due to automatic review settings July 24, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the Bash-based test suite self-checking (assertions + deterministic offline fixtures) and adds GitHub Actions CI to run ShellCheck and the suite across supported Bash versions.

Changes:

  • Introduces a tiny assertion helper (tests/assert.sh) and converts existing tests into self-checking unit/E2E scripts.
  • Refactors the test entrypoint to auto-discover *.test.sh unit tests and explicitly run E2E tests.
  • Adds a CI workflow to run ShellCheck and the test suite in bash:4.1 and bash:5.2, and updates docs + attributes accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/templating.sh Converts templating checks into deterministic, self-checking assertions using ell_echo.
tests/redaction.sh Removes legacy non-asserting redaction script (replaced by plugin unit test).
tests/piping.sh Removes legacy piping script (replaced by helpers/piping.test.sh).
tests/parse_output.sh Adds self-checking parsing tests using file:// fixtures and a helper runner.
tests/logging.sh Removes legacy logging script (replaced by helpers/logging.test.sh).
tests/entry.sh Makes suite runnable from any checkout path; auto-discovers unit tests and runs E2E tests.
tests/docker.sh Runs the suite in both bash container versions and propagates combined status.
tests/assert.sh Adds new assertion library used by unit/E2E tests.
README.md Documents the new test layout, local/Docker usage, and CI behavior.
plugins/redaction/50_post_input.test.sh Adds unit tests for redaction plugin, asserting secrets are removed and markers inserted.
helpers/render_to_text.test.sh Fixes the awk script path now that the test is co-located in helpers/.
helpers/piping.test.sh Adds unit tests for helpers/piping.sh.
helpers/logging.test.sh Adds unit tests for helpers/logging.sh including stderr-only guarantees.
helpers/json.test.sh Adds unit tests for the pure-bash JSON parser (paths, escapes, unicode, validity).
.github/workflows/ci.yml Adds CI: ShellCheck (errors blocking, warnings non-blocking) + test matrix across bash versions.
.gitattributes Ensures consistent LF endings for workflow YAML files.
Comments suppressed due to low confidence (1)

tests/assert.sh:88

  • assert_not_contains has the same glob-pattern issue as assert_contains: needles containing characters like '[' are treated as patterns rather than literal substrings. This can cause false failures/passes (e.g. redaction marker checks). Escape glob metacharacters in the needle before matching.
# assert_not_contains <name> <haystack> <needle>
# Succeeds if <haystack> does NOT contain the literal substring <needle>.
# Useful for security assertions: "the secret must not survive".
assert_not_contains() {
  local name="${1}" haystack="${2}" needle="${3}";
  case "${haystack}" in
    *"${needle}"*)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/assert.sh
Comment thread tests/assert.sh
Comment thread tests/entry.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Comment thread tests/assert.sh
Comment thread tests/templating.sh Outdated
Comment thread .github/workflows/ci.yml
@simonmysun
simonmysun merged commit 394793b into main Jul 24, 2026
3 checks passed
@simonmysun
simonmysun deleted the feat/test-improvements branch September 26, 2026 20:20
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.

[feat] Test automation

2 participants