nixosTests.{qtile,ragnarwm}: migrate to runTestOn

This commit is contained in:
Sigmanificient 2025-03-11 21:24:52 +01:00
parent 9161971a37
commit 1434add94c
3 changed files with 80 additions and 84 deletions

View file

@ -959,7 +959,7 @@ in {
qgis = handleTest ./qgis.nix { package = pkgs.qgis; };
qgis-ltr = handleTest ./qgis.nix { package = pkgs.qgis-ltr; };
qownnotes = handleTest ./qownnotes.nix {};
qtile = handleTestOn ["x86_64-linux" "aarch64-linux"] ./qtile/default.nix {};
qtile = runTestOn ["x86_64-linux" "aarch64-linux"] ./qtile/default.nix;
quake3 = handleTest ./quake3.nix {};
quicktun = handleTest ./quicktun.nix {};
quickwit = handleTest ./quickwit.nix {};
@ -968,7 +968,7 @@ in {
radarr = handleTest ./radarr.nix {};
radicale = handleTest ./radicale.nix {};
radicle = runTest ./radicle.nix;
ragnarwm = handleTest ./ragnarwm.nix {};
ragnarwm = runTestOn ["x86_64-linux" "aarch64-linux"] ./ragnarwm.nix;
rasdaemon = handleTest ./rasdaemon.nix {};
rathole = handleTest ./rathole.nix {};
readarr = handleTest ./readarr.nix {};

View file

@ -1,54 +1,52 @@
import ../make-test-python.nix (
{ lib, ... }:
{
name = "qtile";
{ lib, ... }:
{
name = "qtile";
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
};
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
};
nodes.machine =
{ pkgs, lib, ... }:
let
# We create a custom Qtile configuration file that adds a widget from
# qtile-extras to the bar. This ensure that the qtile-extras package
# also works, and that extraPackages behave as expected.
nodes.machine =
{ pkgs, lib, ... }:
let
# We create a custom Qtile configuration file that adds a widget from
# qtile-extras to the bar. This ensure that the qtile-extras package
# also works, and that extraPackages behave as expected.
config-deriv = pkgs.callPackage ./config.nix { };
in
{
imports = [
../common/x11.nix
../common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
config-deriv = pkgs.callPackage ./config.nix { };
in
{
imports = [
../common/x11.nix
../common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
services.xserver.windowManager.qtile = {
enable = true;
configFile = "${config-deriv}/config.py";
extraPackages = ps: [ ps.qtile-extras ];
};
services.displayManager.defaultSession = lib.mkForce "qtile";
environment.systemPackages = [ pkgs.kitty ];
services.xserver.windowManager.qtile = {
enable = true;
configFile = "${config-deriv}/config.py";
extraPackages = ps: [ ps.qtile-extras ];
};
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
services.displayManager.defaultSession = lib.mkForce "qtile";
with subtest("ensure client is available"):
machine.succeed("qtile --version")
environment.systemPackages = [ pkgs.kitty ];
};
with subtest("ensure we can open a new terminal"):
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
}
)
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
with subtest("ensure client is available"):
machine.succeed("qtile --version")
with subtest("ensure we can open a new terminal"):
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
}

View file

@ -1,40 +1,38 @@
import ./make-test-python.nix (
{ lib, ... }:
{
name = "ragnarwm";
{ lib, ... }:
{
name = "ragnarwm";
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
};
nodes.machine =
{ pkgs, lib, ... }:
{
imports = [
./common/x11.nix
./common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
services.displayManager.defaultSession = lib.mkForce "ragnar";
services.xserver.windowManager.ragnarwm.enable = true;
# Setup the default terminal of Ragnar
environment.systemPackages = [ pkgs.alacritty ];
};
nodes.machine =
{ pkgs, lib, ... }:
{
imports = [
./common/x11.nix
./common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
services.displayManager.defaultSession = lib.mkForce "ragnar";
services.xserver.windowManager.ragnarwm.enable = true;
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
# Setup the default terminal of Ragnar
environment.systemPackages = [ pkgs.alacritty ];
};
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
with subtest("ensure we can open a new terminal"):
# Sleeping a bit before the test, as it may help for sending keys
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
}
)
with subtest("ensure we can open a new terminal"):
# Sleeping a bit before the test, as it may help for sending keys
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
}