Testing
chezmoi uses multiple levels of testing:
-
Unit testing, using
testing
, andgithub.com/alecthomas/assert/v2
, tests that functions and small components behave as expected for a wide range of inputs, especially edge cases. These are generally found ininternal/chezmoi/*_test.go
. -
Filesystem integration tests, using
testing
andgithub.com/twpayne/go-vfs/v5
, test chezmoi's effects on the filesystem. This include some tests ininternal/chezmoi/*_test.go
, and higher level command tests ininternal/cmd/*cmd_test.go
. -
High-level integration tests using
github.com/rogpeppe/go-internal/testscript
are ininternal/cmd/testdata/scripts/*.txtar
and are run byinternal/cmd/main_test.go
. -
Linux distribution and OS tests run the full test suite using Docker for different Linux distributions (in
assets/docker
) and Vagrant for different OSes (inassets/vagrant
). Windows tests are run in GitHub Actions.