Skip to content

Fix example test failures on Windows hosts - #24

Open
NawaMan wants to merge 2 commits into
mainfrom
fix/example-tests-windows
Open

NawaMan wants to merge 2 commits into
mainfrom
fix/example-tests-windows

Conversation

@NawaMan

@NawaMan NawaMan commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

A full examples/workspaces/run-example-tests.sh run on Windows (Git Bash + Docker Desktop) had 14 of 69 examples failing. This fixes the causes that belong to the tests and to the dind setup.

Example tests (8286e644)

  • Stale wrapper path (10 examples): 17 scripts called ../../../codingbooth relative to the cwd; the wrapper is now booth. They now resolve the wrapper from their own location (preferring booth, falling back to codingbooth) and fail with a clear message if neither exists.
  • Emoji checks (all-java, java, go): Git Bash's grep 3.0 cannot match 4-byte UTF-8 emoji under a UTF-8 locale (-F doesn't help). Those checks now run LC_ALL=C grep to match bytes.
  • js-example: test002 checked the servers once after a fixed 2s sleep; the tsx-compiled API server often isn't up yet. It now polls for up to 60s.
  • zig-example: Zig's rename into a bind-mounted .zig-cache fails with AccessDenied; the Justfile sets ZIG_LOCAL_CACHE_DIR to /tmp/zig-cache (overridable).

dind: host-only credential helpers (ff71ccdc)

Docker Desktop writes "credsStore": "desktop" into ~/.docker/config.json. The docker-config extension seeds that into the booth, where docker-credential-desktop doesn't exist, so every docker pull fails — floci and appwrite autostart never come up.

dind--setup.sh now installs /usr/share/startup.d/40-cb-dind--startup.sh, which removes credsStore/credHelpers entries whose docker-credential-* binary isn't on PATH, keeping auths and everything else. It is numbered before the autostart segments and never fails the boot. New unit test: tests/setups/test--dind-docker-config-helpers.sh.

Testing

  • The 10 path-affected examples plus all-java, java, js, go and zig pass individually on Windows.
  • test--dind-docker-config-helpers.sh: 6/6 cases pass inside the base image (it prints SKIP on hosts without jq).
  • In a floci-example booth, running the hook removed desktop, floci/floci:latest pulled, and the S3 round-trip succeeded.
  • Not yet verified: floci-example / appwrite-example through the test runner. They need a base image containing this change, and a locally rebuilt base image is currently ignored — see below.

Known follow-up

The Boothfile compiler emits # syntax=docker/dockerfile:1.7 (cli/src/pkg/boothfile/compiler.go). With that directive the external frontend resolves FROM against the registry, ignoring --pull=false and any local image, so locally rebuilt base images are never used by booth builds. Not addressed here.

🤖 Generated with Claude Code

NawaMan and others added 2 commits September 12, 2026 23:05
- Resolve the booth wrapper from each script's own location instead of a
  cwd-relative ../../../codingbooth, which no longer exists (booth), and
  fail with a clear message when neither wrapper is present.
- Match emoji checks byte-wise (LC_ALL=C grep): Git Bash's grep 3.0 cannot
  match 4-byte UTF-8 emoji under a UTF-8 locale.
- js-example: poll for the servers instead of a fixed 2s sleep; the
  tsx-compiled API server often needs longer.
- zig-example: keep Zig's cache off the bind mount; renaming into a mounted
  .zig-cache fails with AccessDenied on Windows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Docker Desktop writes "credsStore": "desktop" into ~/.docker/config.json.
The docker-config extension seeds that file into the booth, where
docker-credential-desktop does not exist, so every docker pull fails
(floci and appwrite autostart never come up).

dind now installs a 40-cb-dind startup hook that removes credsStore and
credHelpers entries whose docker-credential-* binary is not on PATH,
keeping auths and all other keys. It runs before the autostart segments
and never fails the boot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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