Testing¶
Ideally test changes in Docker containers before committing, but always before pushing to remote.
Quick Reference¶
| Command | Purpose |
|---|---|
just maint test smoke local debian |
Run tests, then exit |
just maint test smoke debug-local bluefin |
Run setup, drop into shell |
just maint test smoke local-all |
Test all distros sequentially |
just dotfiles verify |
Check current machine's health |
Workflow¶
- Make changes to templates in the source directory
- Run
just maint test smoke debug-local <target>to test interactively - Inspect the container environment, verify configs are correct
- Run
just maint test smoke local-allbefore committing
Remote Testing¶
The *-local recipes mount your working tree into the container. There are equivalent *-repo recipes that clone from
the git remote instead — use these to verify what has actually been pushed:
This is useful for confirming that a merge to main works as a fresh chezmoi init would.
Testing a Branch on a Live Machine¶
To apply dotfiles from a feature branch on a device that can't run Docker (e.g., a Mac without root):
Alternatively,
If chezmoi was already initialised, purge the existing state first:
Warning
chezmoi purge removes chezmoi's configuration, state, and source
directory but leaves your deployed files intact. The subsequent chezmoi init --apply should be idempotent but there
is always a risk of breaking your environment on a host. Safe in a container — be careful on a live machine.
Debugging¶
container-shell drops you into a clean base image with no dotfiles or chezmoi installed — just the bare OS, a user
account, and bash. Useful for inspecting what the container looks like before chezmoi runs, or for manually stepping
through the bootstrap:
Available Distros¶
debian— Debian Bookworm (default)fedora— Fedora latestbluefin— Bluefin LTS
macOS Testing¶
Docker smoke tests only cover Linux distros — macOS containers don't exist. A test user account on the same machine would work but requires root/sudo access. Without that, use a macOS VM via UTM or VirtualBuddy — both are installed by the Brewfile on macOS.
Smoke Test Approach¶
Smoke tests simulate a fresh-system bootstrap. The Dockerfile installs only bare minimum OS packages (curl, git,
zsh, sudo) — everything else is installed by chezmoi's run_once scripts. Do not pre-install tools in the
Dockerfile; that masks bugs.
Bluefin exception: Real Bluefin ships with Homebrew but the container image doesn't, so the Dockerfile installs it
and runs ujust bluefin-cli to simulate the real user flow.
Dependency Management¶
External plugins (Zsh plugins, Fonts) are managed via .chezmoiexternals/externals.toml.tmpl.
Pinning Strategy¶
External dependencies are pinned to specific release tags where possible (e.g., v0.9.0) rather than tracking master.
Some projects like Oh My Zsh don't publish releases, so those track master. Pinning prevents upstream breakage and
keeps the setup reproducible across machines. Chezmoi rechecks externals weekly (refreshPeriod = "168h").
Updating Dependencies¶
-
Check what's outdated:
This also runs automatically as part of
just dotfiles update. -
Edit
.chezmoiexternals/externals.toml.tmplwith the new tag. -
Apply and verify on your host:
-
Commit, or rollback the tag if something broke.