Skip to content

test(docker): Add shell tests for the docker libraries. - #122

Open
jackluo923 wants to merge 1 commit into
feat/ca-cert-libfrom
feat/ca-trust-tests
Open

test(docker): Add shell tests for the docker libraries.#122
jackluo923 wants to merge 1 commit into
feat/ca-cert-libfrom
feat/ca-trust-tests

Conversation

@jackluo923

@jackluo923 jackluo923 commented Aug 2, 2026

Copy link
Copy Markdown
Member

Description

Why

This repo has no shell tests, and neither project consuming the ca-trust library exercises it in CI — y-scope/clp-plugin-presto-connector only sources the container half on local builds, and y-scope/clp never passes a CA trust context. So a regression in this library has nowhere to be caught.

What changed

45 assertions covering expired-certificate filtering against two committed fixtures, the empty-bundle and no-bundle paths, the container export matrix, MAVEN_OPTS ordering, command assembly with values containing spaces, quotes, $, and newlines, and the stripping of credentials from image labels and build logs.

The suite runs on every CI platform, including macOS — whose /bin/bash is 3.2. That caught a real one: the libraries used bash namerefs and failed outright on macOS, which #119 now fixes. #119 was green before these tests existed, because nothing exercised it.

Two assertions are regressions for bugs found while integrating y-scope/clp: CA_TRUST_JVM being passed by reference (so a caller that scoped the assignment to the call silently lost JVM trust), and a build-arg helper leaking a nonzero status to an errexit caller when its last variable was unset.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

task test passes.

Every assertion was checked by reintroducing the bug it guards and confirming the suite fails and exits nonzero — a test that has never been seen to fail isn't evidence of anything.

That mattered twice here, and both lessons are baked into the harness:

  • Assertions run in the parent shell. An earlier version ran them inside ( … ), where the failure counter can't propagate, so the suite reported PASSED: 22/22 while silently swallowing 10 assertions.
  • grep -c needs || true. It exits 1 on zero matches, which under errexit aborts the suite instead of failing the assertion — precisely when the regression is present. The CA_TRUST_JVM test hit exactly this and passed against a known-broken library until it was fixed.

A shellcheck task is deliberately not included. The lint workflow only triggers on **/*.py, **/*.pyi, and **/*.yaml, and shellcheck isn't installed in CI, so adding the task here would look like the shell libraries were linted while never actually running. Making it real means changing the workflow's path filters and installing the tool — a repo-wide policy change that should be proposed on its own, once this stack lands.

@jackluo923
jackluo923 requested a review from a team as a code owner August 2, 2026 18:52
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f6f43ccd-385e-4ed6-8d01-9c4c0af92e20

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jackluo923
jackluo923 marked this pull request as draft August 2, 2026 18:54
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch 2 times, most recently from 79646c7 to 13da398 Compare August 2, 2026 19:01
@jackluo923 jackluo923 changed the title test(docker): Add shell tests and a shellcheck task for the docker libraries. test(docker): Add shell tests for the docker libraries. Aug 2, 2026
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch 3 times, most recently from 16a8b88 to f4ab355 Compare August 2, 2026 19:17
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch from f4ab355 to b8603c4 Compare August 2, 2026 19:18
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch from b8603c4 to b6b616d Compare August 2, 2026 22:21
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch from b6b616d to ae8e0ee Compare August 2, 2026 22:43
@jackluo923
jackluo923 marked this pull request as ready for review August 2, 2026 22:47
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch from ae8e0ee to 7d0ae02 Compare August 2, 2026 23:00
@jackluo923
jackluo923 force-pushed the feat/ca-trust-tests branch from 7d0ae02 to 060c45c Compare August 2, 2026 23:24
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.

1 participant