nixpkgs-suyu/nixos/tests/installed-tests
Jan Tojnar 2bfa6aa848
nixosTests.installed-tests: Add the test data to VM closure
Flatpak’s installed tests build Flatpak runtimes, among other things.
Upstream code does this by copying some programs on `PATH`
as well as some possible dependencies from host’s /usr.
We patch the code to use `nix-store --query --requisites`
to make the dependency discovery easier.

The Flatpak’s installed tests add `socat` to `PATH` and later run
`nix-store --query --requisites` on its location but it was failing with

    error: path '/nix/store/qcyf7nq5vvfw32967sv4j6z190inrbrc-socat-1.7.3.4' is not valid

The issue occurred because, while the host Nix store is bind mounted into the test VM,
the VM’s store uses its own database that only contains the packages in the VM’s closure.
Since the test commands are not actually part of the VM but only passed through PTY,
the `flatpak.installedTests` derivation was not part of the VM’s closure, so `nix-store`
in the VM could not get information about its dependency `socat`.

Let’s make the `installedTests` of the tested package part of the test VM’s closure
by passing it as a global environment variable. This will also have the added benefit
that user no longer has to type the path when running the installed tests manually in the VM;
they can just use `gnome-desktop-testing-runner -d $TESTED_PACKAGE_INSTALLED_TESTS`,
which is much more conducive to tab completion.
2020-07-24 16:30:49 +02:00
..
colord.nix
default.nix nixosTests.installed-tests: Add the test data to VM closure 2020-07-24 16:30:49 +02:00
flatpak-builder.nix
flatpak.nix
fwupd.nix nixos/fwupd: disable test plugins implicitly 2020-02-06 22:32:13 +01:00
gcab.nix gcab: run & install tests 2019-11-07 14:07:19 +01:00
gdk-pixbuf.nix
gjs.nix
glib-networking.nix
glib-testing.nix glib-testing: init at 0.1.0 2020-02-10 12:55:24 -05:00
gnome-photos.nix
graphene.nix
ibus.nix Revert "Revert "ibus: fix dconf db installation"" 2020-06-02 22:34:59 +02:00
libgdata.nix nixosTests.libgdata: port to python, move to installed-tests 2019-11-07 08:07:51 -05:00
libjcat.nix libjcat: init at 0.1.1 2020-04-15 20:30:06 +02:00
libxmlb.nix nixosTests.libxmlb: port to python 2019-11-07 08:02:33 -05:00
malcontent.nix malcontent: init at 0.4.0 2020-02-10 12:55:24 -05:00
ostree.nix
xdg-desktop-portal.nix xdg-desktop-portal: 1.4.2 → 1.6.0 2020-02-10 12:55:25 -05:00