nixos/tests/immichframe: fix potential test failures

This commit is contained in:
Morgan Jones
2026-07-10 01:45:12 -07:00
parent 2a28ddd27e
commit cb21f8f187
+17 -6
View File
@@ -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")