[Nix-dev] NixOS configuration unit tests

Matthias Beyer mail at beyermatthias.de
Fri Jan 23 15:20:06 CET 2015


On 23-01-2015 14:04:22, Wout Mertens wrote:
>    I'm thinking that it might be a good idea to have unit tests for the
>    configuration.nix descriptions. That way we can be more sure that a change
>    doesn't have unintended consequences.

Really good idea!

>    For example, we could have tests like "if you set config.foo and
>    config.bar, the evaluation should fail" and "if you set config.foo then
>    config.baz should get a value".
>    One specific use case is the license whitelisting/blacklisting
>    (https://github.com/NixOS/nixpkgs/pull/5892), where we don't ever want to
>    inadvertently allow forbidden licenses.
>    Any thoughts on how to implement this? An approach might be a shell script
>    that runs a few nix-instantiate command lines and expects errors and
>    values, but how would that integrate with the nixos tests?
>    Wout.

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150123/e2811520/attachment.bin 


More information about the nix-dev mailing list