From e70b0cf70270669cf3890679726d821edabdf15e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 16 Nov 2025 17:15:38 +0900 Subject: [PATCH 1/3] nixos/tests/ringboard: add h7x4 to maintainers --- nixos/tests/ringboard.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/ringboard.nix b/nixos/tests/ringboard.nix index a0bd26c25c51..9825a46d50d1 100644 --- a/nixos/tests/ringboard.nix +++ b/nixos/tests/ringboard.nix @@ -6,7 +6,7 @@ }: { name = "ringboard"; - meta = { inherit (pkgs.ringboard.meta) maintainers; }; + meta.maintainers = pkgs.ringboard.meta.maintainers ++ (with lib.maintainers; [ h7x4 ]); nodes.machine = { imports = [ From cc660fbc680fdcabbd53817f783dbaa6e6c39c09 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 16 Nov 2025 17:16:09 +0900 Subject: [PATCH 2/3] nixos/tests/ringboard: poll for gedit to show up on screen While polling with `pgrep` earlier, there was a slight chance that the test might start writing before the application had finished initializing. Waiting for the actual application to show up on screen should be a better target for avoiding such a race condition. --- nixos/tests/ringboard.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/tests/ringboard.nix b/nixos/tests/ringboard.nix index 9825a46d50d1..b1072d9f3267 100644 --- a/nixos/tests/ringboard.nix +++ b/nixos/tests/ringboard.nix @@ -17,12 +17,14 @@ test-support.displayManager.auto.user = "alice"; services.xserver.displayManager.sessionCommands = '' - '${lib.getExe pkgs.gedit}' & + '${lib.getExe pkgs.gedit}' my_document & ''; services.ringboard.x11.enable = true; }; + enableOCR = true; + testScript = { nodes, ... }: let @@ -31,7 +33,8 @@ '' @polling_condition def gedit_running(): - machine.succeed("pgrep gedit") + "Check that gedit is running and visible to the user" + machine.wait_for_text("my_document") with subtest("Wait for service startup"): machine.wait_for_unit("graphical.target") From 4ac0b857fb4db229780bf02cdede9276c26e734a Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 16 Nov 2025 17:17:56 +0900 Subject: [PATCH 3/3] nixos/tests/ringboard: add some slight delays between keypresses --- nixos/tests/ringboard.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/tests/ringboard.nix b/nixos/tests/ringboard.nix index b1072d9f3267..96dc759fbf29 100644 --- a/nixos/tests/ringboard.nix +++ b/nixos/tests/ringboard.nix @@ -43,10 +43,12 @@ with subtest("Ensure clipboard is monitored"): with gedit_running: # type: ignore[union-attr] - machine.send_chars("Hello world!") + machine.send_chars("Hello world!", delay=0.1) + machine.sleep(1) machine.send_key("ctrl-a") + machine.sleep(1) machine.send_key("ctrl-c") - machine.wait_for_console_text("Small selection transfer complete") - machine.succeed("su - '${user}' -c 'ringboard search Hello | grep world!'") + machine.wait_until_succeeds("su - '${user}' -c 'journalctl --user -u ringboard-listener.service --grep \'Small selection transfer complete\'''", timeout=60) + machine.succeed("su - '${user}' -c 'ringboard search Hello | grep world!'") ''; }