1
1
mirror of https://github.com/divnix/digga.git synced 2024-11-26 12:03:03 +03:00
digga/doc/tests.md
David Arnold fee8829dd7 docs: add general docs (w/o library reference)
library reference expected to come as soon as flake-utils-plus has
the corresponding implementation.
2022-02-23 15:23:14 -08:00

1.7 KiB

Testing

Testing is always an important aspect of any software development project, and NixOS offers some incredibly powerful tools to write tests for your configuration, and, optionally, run them in CI.

Unit Tests

Unit tests can be created from regular derivations, and they can do almost anything you can imagine. By convention, it is best to test your packages during their check phase. All packages and their tests will be built during CI.

Integration Tests

All your profiles defined in suites will be tested in a NixOS VM.

You can write integration tests for one or more NixOS VMs that can, optionally, be networked together, and yes, it's as awesome as it sounds!

Be sure to use the mkTest function from digga, digga.lib.pkgs-lib.mkTest which wraps the official testing-python function to ensure that the system is setup exactly as it is for a bare DevOS system. There are already great resources for learning how to use these tests effectively, including the official docs, a fantastic blog post, and the examples in nixpkgs.