nixosTests.{qtile,qtile-extras}: Seperate to distint tests

This commit is contained in:
Gurjaka 2025-07-01 12:36:58 +04:00 committed by Sigmanificient
parent 29c8aa18b9
commit 9200c874c5
6 changed files with 66 additions and 10 deletions

View File

@ -1250,7 +1250,8 @@ in
qgis = handleTest ./qgis.nix { package = pkgs.qgis; }; qgis = handleTest ./qgis.nix { package = pkgs.qgis; };
qgis-ltr = handleTest ./qgis.nix { package = pkgs.qgis-ltr; }; qgis-ltr = handleTest ./qgis.nix { package = pkgs.qgis-ltr; };
qownnotes = runTest ./qownnotes.nix; qownnotes = runTest ./qownnotes.nix;
qtile = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./qtile/default.nix; qtile = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./qtile.nix;
qtile-extras = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./qtile-extras/default.nix;
quake3 = runTest ./quake3.nix; quake3 = runTest ./quake3.nix;
quicktun = runTest ./quicktun.nix; quicktun = runTest ./quicktun.nix;
quickwit = runTest ./quickwit.nix; quickwit = runTest ./quickwit.nix;

View File

@ -1,6 +1,9 @@
{ stdenvNoCC, fetchurl }: {
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
name = "qtile-config"; name = "qtile-extras-config";
version = "0.0.1"; version = "0.0.1";
src = fetchurl { src = fetchurl {

View File

@ -1,18 +1,24 @@
{ lib, ... }: { lib, ... }:
{ {
name = "qtile"; name = "qtile-extras";
meta = { meta = {
maintainers = with lib.maintainers; [ sigmanificient ]; maintainers = with lib.maintainers; [
sigmanificient
gurjaka
];
}; };
nodes.machine = nodes.machine =
{ pkgs, lib, ... }: {
pkgs,
lib,
...
}:
let let
# We create a custom Qtile configuration file that adds a widget from # We create a custom Qtile configuration file that adds a widget from
# qtile-extras to the bar. This ensure that the qtile-extras package # qtile-extras to the bar. This ensure that the qtile-extras package
# also works, and that extraPackages behave as expected. # also works, and that extraPackages behave as expected.
config-deriv = pkgs.callPackage ./config.nix { }; config-deriv = pkgs.callPackage ./config.nix { };
in in
{ {
@ -43,10 +49,8 @@
machine.succeed("qtile --version") machine.succeed("qtile --version")
with subtest("ensure we can open a new terminal"): with subtest("ensure we can open a new terminal"):
machine.sleep(2)
machine.send_key("meta_l-ret") machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine") machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal") machine.screenshot("terminal")
''; '';
} }

46
nixos/tests/qtile.nix Normal file
View File

@ -0,0 +1,46 @@
{ lib, ... }:
{
name = "qtile";
meta = {
maintainers = with lib.maintainers; [
sigmanificient
gurjaka
];
};
nodes.machine =
{
pkgs,
lib,
...
}:
{
imports = [
./common/x11.nix
./common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
services.xserver.windowManager.qtile.enable = true;
services.displayManager.defaultSession = lib.mkForce "qtile";
environment.systemPackages = [ pkgs.kitty ];
};
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.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.screenshot("terminal")
'';
}

View File

@ -17,8 +17,8 @@
requests, requests,
setuptools-scm, setuptools-scm,
xorgserver, xorgserver,
nixosTests,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "qtile-extras"; pname = "qtile-extras";
version = "0.33.0"; version = "0.33.0";
@ -86,6 +86,8 @@ buildPythonPackage rec {
pythonImportsCheck = [ "qtile_extras" ]; pythonImportsCheck = [ "qtile_extras" ];
passthru.tests.qtile-extras = nixosTests.qtile-extras;
meta = with lib; { meta = with lib; {
description = "Extra modules and widgets for the Qtile tiling window manager"; description = "Extra modules and widgets for the Qtile tiling window manager";
homepage = "https://github.com/elParaguayo/qtile-extras"; homepage = "https://github.com/elParaguayo/qtile-extras";