From c6eb691fb8cd0616b85d1e6d91c650030f3250ac Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 23 Aug 2019 03:16:28 +0200 Subject: gnome-photos: add installed tests --- nixos/tests/all-tests.nix | 1 + nixos/tests/gnome-photos.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 nixos/tests/gnome-photos.nix (limited to 'nixos/tests') diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4eeee9c35c07..6e3e06889200 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -97,6 +97,7 @@ in glusterfs = handleTest ./glusterfs.nix {}; gnome3-xorg = handleTest ./gnome3-xorg.nix {}; gnome3 = handleTest ./gnome3.nix {}; + gnome-photos = handleTest ./gnome-photos.nix {}; gocd-agent = handleTest ./gocd-agent.nix {}; gocd-server = handleTest ./gocd-server.nix {}; google-oslogin = handleTest ./google-oslogin {}; diff --git a/nixos/tests/gnome-photos.nix b/nixos/tests/gnome-photos.nix new file mode 100644 index 000000000000..2ecda1d68ce3 --- /dev/null +++ b/nixos/tests/gnome-photos.nix @@ -0,0 +1,42 @@ +# run installed tests +import ./make-test.nix ({ pkgs, lib, ... }: + +let + + # gsettings tool with access to gsettings-desktop-schemas + desktop-gsettings = with pkgs; stdenv.mkDerivation { + name = "desktop-gsettings"; + dontUnpack = true; + nativeBuildInputs = [ glib wrapGAppsHook ]; + buildInputs = [ gsettings-desktop-schemas ]; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + ln -s ${glib.bin}/bin/gsettings $out/bin/desktop-gsettings + runHook postInstall + ''; + }; + +in + +{ + name = "gnome-photos"; + meta = { + maintainers = pkgs.gnome-photos.meta.maintainers; + }; + + machine = { pkgs, ... }: { + imports = [ ./common/x11.nix ]; + programs.dconf.enable = true; + services.gnome3.at-spi2-core.enable = true; # needed for dogtail + environment.systemPackages = with pkgs; [ gnome-desktop-testing desktop-gsettings ]; + services.dbus.packages = with pkgs; [ gnome-photos ]; + }; + + testScript = '' + $machine->waitForX; + # dogtail needs accessibility enabled + $machine->succeed("desktop-gsettings set org.gnome.desktop.interface toolkit-accessibility true 2>&1"); + $machine->succeed("gnome-desktop-testing-runner -d '${pkgs.gnome-photos.installedTests}/share' 2>&1"); + ''; +}) -- cgit 1.4.1