From cb21f8f187ea7c25fffa000c37b97558dab08a95 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Fri, 10 Jul 2026 01:45:12 -0700 Subject: [PATCH] nixos/tests/immichframe: fix potential test failures --- nixos/tests/web-apps/immichframe.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/nixos/tests/web-apps/immichframe.nix b/nixos/tests/web-apps/immichframe.nix index f2f590470163..436965089eab 100644 --- a/nixos/tests/web-apps/immichframe.nix +++ b/nixos/tests/web-apps/immichframe.nix @@ -1,10 +1,18 @@ +{ + lib, + ... +}: + let apiKeyFile = "/tmp/immich-api.key"; customInterval = 5; + user = "alice"; in { name = "immichframe"; + meta.maintainers = with lib.maintainers; [ numinit ]; + enableOCR = true; nodes.machine = @@ -15,11 +23,17 @@ in ... }: { - imports = [ ../common/x11.nix ]; + imports = [ + ../common/user-account.nix + ../common/x11.nix + ]; # When setting this to 2500 I got "Kernel panic - not syncing: Out of # memory: compulsory panic_on_oom is enabled". virtualisation.memorySize = 3000; + hardware.graphics.enable = true; + environment.variables.XAUTHORITY = "/home/${user}/.Xauthority"; + test-support.displayManager.auto.user = user; environment.systemPackages = with pkgs; [ imagemagick @@ -69,6 +83,7 @@ in custom_interval = ${toString customInterval} + machine.wait_for_x() machine.wait_for_unit("immich-server.service") machine.wait_for_open_port(2283) @@ -133,11 +148,7 @@ in assert len(assets) == 2, assets # Wait for a photo to be displayed. - machine.wait_for_x() - machine.execute("xterm -e 'firefox --kiosk http://localhost:8002' >&2 &") - machine.wait_for_window("immichFrame") - _, active_window = machine.execute("xdotool getactivewindow") - machine.succeed(f"xdotool windowsize {quote(active_window.strip())} 100% 100%") + machine.execute("su - ${user} -c 'firefox --kiosk http://localhost:8002' >&2 & disown") machine.wait_for_text('reproduce this moment') machine.wait_for_text('with NixOS tests') machine.screenshot("screen")