Skip to content

test: run the test suite in a Docker sandbox - #43

Merged
llbbl merged 1 commit into
mainfrom
test/42-docker-sandbox
Nov 8, 2026
Merged

llbbl merged 1 commit into
mainfrom
test/42-docker-sandbox

Conversation

@llbbl

@llbbl llbbl commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Closes #42

Runs the whole test suite inside a hardened Docker container, so a test that shells out can't touch the host.

  • Dockerfile.test and compose.yaml (service test): the repo is copied into the image, with a read-only root filesystem, tmpfs /tmp, a non-root user, all capabilities dropped and no-new-privileges.
  • .dockerignore is an allowlist: only src/, tests/, scripts/ and the package/tsconfig files go in, and credential and secret names are re-excluded at any depth.
  • Every test file imports tests/setup/require-sandbox.test.ts first. It refuses to run outside the container, from any cwd, and tests/setup/guard-coverage.test.ts fails if a test file is missing the import.
  • just test, test-coverage, coverage-check and test-watch run through docker compose. CI and the release Verify step do the same, while lint, typecheck and build stay on the runner.
  • docs/DEVELOPMENT.md describes what is and isn't contained: network access is still on, and a PR that edits the guard is caught only by review.

Tests now run only in a locked-down container: the repo is copied in through an
allowlisted build context, with a read-only filesystem, a non-root user, all
capabilities dropped and no-new-privileges. Every test file imports a guard that
refuses to run outside the sandbox from any working directory, and
guard-coverage.test.ts fails if a test file lacks it. The just recipes, ci.yml
and the auto-release Verify step all run tests through docker compose.

Closes #42
@llbbl
llbbl merged commit 91eddec into main Nov 8, 2026
3 checks passed
@llbbl
llbbl deleted the test/42-docker-sandbox branch November 8, 2026 20:14
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.

test: run the test suite in a Docker sandbox

1 participant