clan-app: add basic smoke test using OCR + nixos tests

This commit is contained in:
DavHau
2025-04-24 18:06:54 +07:00
parent 4be8f7d973
commit 39c13a5c38
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
{ self, pkgs, ... }:
{
name = "app-ocr-smoke-test";
enableOCR = true;
nodes = {
wayland =
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/../tests/common/wayland-cage.nix") ];
services.cage.program = "${self.packages.${pkgs.system}.clan-app}/bin/clan-app";
virtualisation.memorySize = 2047;
# TODO: get rid of this and fix debus-proxy error instead
services.cage.environment.WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS = "1";
};
xorg =
{ pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/../tests/common/user-account.nix")
(modulesPath + "/../tests/common/x11.nix")
];
virtualisation.memorySize = 2047;
services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = "${
self.packages.${pkgs.system}.clan-app
}/bin/clan-app";
test-support.displayManager.auto.user = "alice";
};
};
testScript = ''
start_all()
wayland.wait_for_unit('graphical.target')
xorg.wait_for_unit('graphical.target')
wayland.wait_for_text('Welcome to Clan')
xorg.wait_for_text('Welcome to Clan')
'';
}

View File

@@ -79,6 +79,8 @@ in
# import our test # import our test
secrets = import ./secrets nixosTestArgs; secrets = import ./secrets nixosTestArgs;
container = import ./container nixosTestArgs; container = import ./container nixosTestArgs;
# Clan app tests
app-ocr = self.clanLib.test.baseTest ./app-ocr nixosTestArgs;
}; };
}; };
}; };