diff --git a/checks/app-ocr/default.nix b/checks/app-ocr/default.nix new file mode 100644 index 000000000..3ff92c5cf --- /dev/null +++ b/checks/app-ocr/default.nix @@ -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') + ''; +} diff --git a/checks/flake-module.nix b/checks/flake-module.nix index 17f0022ef..33c3d41f4 100644 --- a/checks/flake-module.nix +++ b/checks/flake-module.nix @@ -79,6 +79,8 @@ in # import our test secrets = import ./secrets nixosTestArgs; container = import ./container nixosTestArgs; + # Clan app tests + app-ocr = self.clanLib.test.baseTest ./app-ocr nixosTestArgs; }; }; };