minecraft: Add test

This commit is contained in:
Tim Steinbach 2020-11-28 12:42:10 -05:00
parent eb2a3a040c
commit 0dc74a15ad
No known key found for this signature in database
GPG Key ID: FD36A5EAAC49035A
3 changed files with 34 additions and 1 deletions

View File

@ -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 {};

28
nixos/tests/minecraft.nix Normal file
View File

@ -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")
'';
})

View File

@ -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;
};
}