mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 06:31:02 +00:00
72197a5c79
Hydra accepts timeouts as value of seconds after which the test is terminated / considered failed. Using the value 30 here has the effect that the test was terminate after 30 seconds. That time might be sufficient for the test execution itself but it has another downside: Jobs on hydra inherit the timeout of their parent. In this case all the builds that are a dependency of the herbstluftwm test *must* finish (each) within 30s. And since not all of the dependencies are cached in the binary cache this could lead to an issue with pacakges that take longer than 30s to build at the time when the herbstluftwm test is built by hydra. It is best to not set the timeout here and let hydra deal with it. Our default timeout for builds is two hours which is more than sufficient for most builds and tests. If the test fails we will spent ~2h doing something or nothing at worst but at least we wont kill the build just because a dependency wasn't fullfilled already.
38 lines
1.2 KiB
Nix
38 lines
1.2 KiB
Nix
import ./make-test-python.nix ({ lib, ...} : {
|
|
name = "herbstluftwm";
|
|
|
|
meta = {
|
|
maintainers = with lib.maintainers; [ thibautmarty ];
|
|
};
|
|
|
|
machine = { pkgs, lib, ... }: {
|
|
imports = [ ./common/x11.nix ./common/user-account.nix ];
|
|
test-support.displayManager.auto.user = "alice";
|
|
services.xserver.displayManager.defaultSession = lib.mkForce "none+herbstluftwm";
|
|
services.xserver.windowManager.herbstluftwm.enable = true;
|
|
environment.systemPackages = [ pkgs.dzen2 ]; # needed for upstream provided panel
|
|
};
|
|
|
|
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("herbstclient --version")
|
|
|
|
with subtest("ensure keybindings are set"):
|
|
machine.wait_until_succeeds("herbstclient list_keybinds | grep xterm")
|
|
|
|
with subtest("ensure panel starts"):
|
|
machine.wait_for_window("dzen title")
|
|
|
|
with subtest("ensure we can open a new terminal"):
|
|
machine.send_key("alt-ret")
|
|
machine.wait_for_window(r"alice.*?machine")
|
|
machine.sleep(2)
|
|
machine.screenshot("terminal")
|
|
'';
|
|
})
|