Merge pull request #286343 from fgaz/urn-timer/nixos-test

nixosTests.urn-timer: init
This commit is contained in:
Weijia Wang 2024-02-05 01:57:20 +01:00 committed by GitHub
commit 1f4b41071c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 0 deletions

View file

@ -934,6 +934,7 @@ in {
upnp.nftables = handleTest ./upnp.nix { useNftables = true; };
uptermd = handleTest ./uptermd.nix {};
uptime-kuma = handleTest ./uptime-kuma.nix {};
urn-timer = handleTest ./urn-timer.nix {};
usbguard = handleTest ./usbguard.nix {};
user-activation-scripts = handleTest ./user-activation-scripts.nix {};
user-expiry = runTest ./user-expiry.nix;

26
nixos/tests/urn-timer.nix Normal file
View file

@ -0,0 +1,26 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "urn-timer";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
nodes.machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
environment.systemPackages = [ pkgs.urn-timer ];
};
enableOCR = true;
testScript =
''
machine.wait_for_x()
machine.execute("urn-gtk ${pkgs.urn-timer.src}/splits_examples/sotn.json >&2 &")
machine.wait_for_window("urn")
machine.wait_for_text(r"(Mist|Bat|Reverse|Dracula)")
machine.screenshot("screen")
'';
})

View file

@ -7,6 +7,7 @@
, wrapGAppsHook
, gtk3
, jansson
, nixosTests
}:
stdenv.mkDerivation {
@ -38,6 +39,8 @@ stdenv.mkDerivation {
url = "https://github.com/paoloose/urn.git";
};
passthru.tests.nixosTest = nixosTests.urn-timer;
meta = with lib; {
homepage = "https://github.com/paoloose/urn";
description = "Split tracker / timer for speedrunning with GTK+ frontend";