nixpkgs/nixos/lib
Léo Gaspard 02e1f00ffd
dovecot, opensmtpd: add link to test in meta.tests
Rationale
---------

Currently, tests are hard to discover. For instance, someone updating
`dovecot` might not notice that the interaction of `dovecot` with
`opensmtpd` is handled in the `opensmtpd.nix` test.

And even for someone updating `opensmtpd`, it requires manual work to go
check in `nixos/tests` whether there is actually a test, especially
given not so many packages in `nixpkgs` have tests and this is thus most
of the time useless.

Finally, for the reviewer, it is much easier to check that the “Tested
via one or more NixOS test(s)” has been checked if the file modified
already includes the list of relevant tests.

Implementation
--------------

Currently, this commit only adds the metadata in the package. Each
element of the `meta.tests` attribute is a derivation that, when it
builds successfully, means the test has passed (ie. following the same
convention as NixOS tests).

Future Work
-----------

In the future, the tools could be made aware of this `meta.tests`
attribute, and for instance a `--with-tests` could be added to
`nix-build` so that it also builds all the tests. Or a `--without-tests`
to build without all the tests. @Profpatsch described in his NixCon talk
such systems.

Another thing that would help in the future would be the possibility to
reasonably easily have cross-derivation nix tests without the whole
NixOS VM stack. @7c6f434c already proposed such a system.

This RFC currently handles none of these concerns. Only the addition of
`meta.tests` as metadata to be used by maintainers to remember to run
relevant tests.
2018-10-30 21:31:39 +09:00
..
test-driver Add ssh backdoor to VM tests infrastructure. 2018-09-28 10:53:08 +01:00
testing jquery & jquery-ui: Move to nixos/lib/testing/ 2018-02-27 20:07:35 +08:00
build-vms.nix nixos: doc: move non-service parts of service.nixosManual to documentation.nixos 2018-09-23 20:50:47 +00:00
eval-config.nix Merge pull request #46341 from obsidiansystems/fix-46320 2018-09-08 09:16:41 -04:00
from-env.nix
make-channel.nix Unify NixOS and Nixpkgs channel structure 2015-08-05 17:37:11 +02:00
make-disk-image.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
make-ext4-fs.nix make-ext4-fs: Fix cross compiling 2018-08-21 14:05:23 +03:00
make-iso9660-image.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
make-iso9660-image.sh ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-squashfs.nix ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-system-tarball.nix reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
make-system-tarball.sh make-system-tarball: allow alternate compression methods 2018-04-03 11:30:43 -03:00
qemu-flags.nix reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
testing.nix dovecot, opensmtpd: add link to test in meta.tests 2018-10-30 21:31:39 +09:00
utils.nix nixos: generalize copy-paste from stage-1 and zfs to utils 2016-08-23 18:14:06 +00:00