Skip to content

Slice 2: CI for the test suite - #4

Merged
zanellig merged 2 commits into
mainfrom
ci/test-suite
Sep 3, 2026
Merged

zanellig merged 2 commits into
mainfrom
ci/test-suite

Conversation

@zanellig

@zanellig zanellig commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #2.

Adds .github/workflows/ci.yml, running on push and pull_request:

  • bash -n on kill-dev-servers.sh, install.sh, tests/test-cli.sh (one file per invocation — bash -n only reads its first file argument)
  • shellcheck on the same three files (preinstalled on ubuntu-latest)
  • bash tests/test-cli.sh

ubuntu-latest because the suite spawns real background PIDs and the script reads /proc.

Turning shellcheck on surfaced findings that had to be fixed to make the gate green:

  • kill-dev-servers.sh:279 — unquoted ${BASH_REMATCH[1]} inside a ${var#pattern} pattern (SC2295)
  • kill-dev-servers.sh:364-367 — redundant $ on arithmetic array indices (SC2004)
  • kill-dev-servers.sh — the associative target_indices local in collect_candidates shared a name with the top-level positional index array; the top-level one is now selected_indices (SC2190)
  • tests/test-cli.sh — unquoted $repo_dir in command substitutions (SC2086)
  • kill-dev-servers.sh:1 — duplicated shebang line

All behavior-preserving; bash tests/test-cli.sh passes and shellcheck is clean locally.

Not included: the bash 4 matrix the issue floats as optional. No runner or distro image gives a bash 4 with procps ps and /proc (the bash:4.x images are BusyBox/Alpine, already unsupported per the README), so it would mean building bash from source in CI. The README's "Bash 4 or newer" claim stays untested. Installer coverage is likewise left out, as the issue notes it is a separate question.

🤖 Generated with Claude Code

zanellig and others added 2 commits September 3, 2026 17:00
Adds a GitHub Actions workflow on ubuntu-latest (the suite spawns real PIDs
and reads /proc, so it needs a Linux runner). Fixes the shellcheck findings
the new gate surfaced: unquoted expansion inside a pattern, redundant $ on
arithmetic array indices, a name collision between the associative
target_indices local and the top-level index array, an unquoted $repo_dir in
the tests, and a duplicated shebang line.

Closes #2

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The first CI run failed on the pretty-table assertion: `sort` collates by
locale, so a listener bound to both `*:3002` and `127.0.0.1:3002` came out in
one order under en_US.UTF-8 and the other under the runner's C locale. BIND
ordering should not depend on the environment's locale, so pin the sort to
LC_ALL=C and assert the C order in the suite.

Also limit the push trigger to main so PR branches get one run, not two.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98e16726ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
run: shellcheck $SCRIPTS

- name: CLI tests
run: bash tests/test-cli.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make the binding-order assertion compatible with CI

On the Ubuntu runner's C.UTF-8 locale, the suite fails at tests/test-cli.sh:118: listener discovery sorts the mocked endpoints before rendering them, placing *:3002 before 127.0.0.1:3002, while the assertion requires the reverse order. Running this exact step produces FAIL: second pretty row lacks process metadata or bindings, so the newly added CI job will fail consistently unless the assertion accepts the sorted order (or otherwise ignores endpoint ordering).

Useful? React with 👍 / 👎.

@zanellig

zanellig commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review the latest fixes on commit 3dbdbce: the P1 binding-order finding is fixed at the source rather than in the assertion. Listener discovery now sorts with LC_ALL=C, so BIND ordering is deterministic instead of varying with the environment's locale, and the suite asserts that C order (*:3002, 127.0.0.1:3002). Verified green under LC_ALL=C, en_US.UTF-8, and the runner. The same commit also narrows the push trigger to main so PR branches get one CI run instead of two.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 3dbdbcebd0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zanellig
zanellig merged commit b8e4ef0 into main Sep 3, 2026
1 check passed
@zanellig
zanellig deleted the ci/test-suite branch September 3, 2026 20:24
@zanellig zanellig mentioned this pull request Sep 3, 2026
3 tasks
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.

Set up CI to run the test suite

1 participant