diff options
author | Tim Steinbach <tim@nequissimus.com> | 2020-11-28 12:42:10 -0500 |
---|---|---|
committer | Tim Steinbach <tim@nequissimus.com> | 2020-11-28 12:43:17 -0500 |
commit | 0dc74a15ad55f0882895319eb16b0aa9a9f4f82d (patch) | |
tree | af5c1dd2fa3a9ef05c1864bf65aa828410b9ee9e | |
parent | eb2a3a040cefc6649a117925832b23059fc79b7c (diff) |
minecraft: Add test
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/minecraft.nix | 28 | ||||
-rw-r--r-- | pkgs/games/minecraft/default.nix | 6 |
3 files changed, 34 insertions, 1 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 771ee9bdbd330..f6c0c24839284 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -208,6 +208,7 @@ in mediawiki = handleTest ./mediawiki.nix {}; memcached = handleTest ./memcached.nix {}; metabase = handleTest ./metabase.nix {}; + minecraft = handleTest ./minecraft.nix {}; miniflux = handleTest ./miniflux.nix {}; minio = handleTest ./minio.nix {}; minidlna = handleTest ./minidlna.nix {}; diff --git a/nixos/tests/minecraft.nix b/nixos/tests/minecraft.nix new file mode 100644 index 0000000000000..e0c35f2d27695 --- /dev/null +++ b/nixos/tests/minecraft.nix @@ -0,0 +1,28 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "minecraft"; + meta = with lib.maintainers; { maintainers = [ nequissimus ]; }; + + nodes.client = { nodes, ... }: + let user = nodes.client.config.users.users.alice; + in { + imports = [ ./common/user-account.nix ./common/x11.nix ]; + + environment.systemPackages = [ pkgs.minecraft ]; + + nixpkgs.config.allowUnfree = true; + + test-support.displayManager.auto.user = user.name; + }; + + enableOCR = true; + + testScript = { nodes, ... }: + let user = nodes.client.config.users.users.alice; + in '' + client.wait_for_x() + client.execute("su - alice -c minecraft-launcher &") + client.wait_for_text("CONTINUE WITHOUT LOGIN") + client.sleep(10) + client.screenshot("launcher") + ''; +}) diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix index 7ef2f533476ff..1b4cf31972104 100644 --- a/pkgs/games/minecraft/default.nix +++ b/pkgs/games/minecraft/default.nix @@ -1,5 +1,6 @@ { stdenv , fetchurl +, nixosTests , makeDesktopItem , makeWrapper , wrapGAppsHook @@ -147,5 +148,8 @@ stdenv.mkDerivation rec { platforms = [ "x86_64-linux" ]; }; - passthru.updateScript = ./update.sh; + passthru = { + tests = { inherit (nixosTests) minecraft; }; + updateScript = ./update.sh; + }; } |