Skip to content

Rewrite smoke test: single container, execution and version checks - #6

Open
ngpayyappilly wants to merge 1 commit into
mainfrom
claude/smoke-test-v2
Open

ngpayyappilly wants to merge 1 commit into
mainfrom
claude/smoke-test-v2

Conversation

@ngpayyappilly

Copy link
Copy Markdown
Owner

Summary

The previous smoke test ran about 45 separate docker runs, only checked that most tools existed (command -v), and hid a failure with || true. Rewritten:

  • One container runs the whole check body (a single container start instead of ~45).
  • Execution checks for incident-critical tools (tcpdump, strace, gdb, bpftrace, nmap, dig, openssl, iperf3, ...). command -v cannot catch a wrong-arch binary or a missing shared library.
  • Version assertions: kubectl, yq, stern and grpcurl must match the ARGs in the Dockerfile, so a bump that did not take effect fails CI.
  • Shell config checks: alias k, kubectl completion registered for k, the banner shown for interactive shells, and non-interactive shells staying silent (this guards the bashrc fix in Fix bashrc interactive guard, bake kubectl completion, load for any HOME #3). No more || true.
  • --db-clients flag to verify the INSTALL_DB_CLIENTS=true variant. Not wired into CI yet; a build-matrix entry would be a follow-up.

Testing

No Docker daemon in my environment, so I could not run it against a built image. I ran the script with a stand-in docker that executes the test body locally:

  • With the real pinned kubectl, yq, stern and grpcurl binaries on PATH, every version assertion passes.
  • With the Dockerfile ARG changed to YQ_VERSION=v9.9.9, it fails with yq version is not 9.9.9 and exits non-zero.
  • Missing tools are reported individually.

The remaining local FAILs are tools that simply are not installed in the sandbox. The PR workflow runs it against the real image on amd64 and arm64.

shellcheck is not available in my environment; the PR lint job will run it.

Part of an SRE review series (test quality).


Generated by Claude Code

- Run all checks in one container instead of ~45 `docker run`s.
- Execute incident-critical tools (tcpdump, strace, gdb, bpftrace, nmap,
  dig, openssl, ...) rather than only `command -v`, which cannot catch
  wrong-arch binaries or missing shared libraries.
- Assert kubectl/yq/stern/grpcurl versions match the Dockerfile ARGs.
- Assert kubectl completion and the motd banner load for the interactive
  shell, and that non-interactive shells stay silent. No longer swallows
  failures with `|| true`.
- Add --db-clients to verify the INSTALL_DB_CLIENTS=true variant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iDTyB5N8EdZyyZo4ymUVR

This branch has not been deployed

No deployments
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.

2 participants