about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-01-16 16:21:06 +0800
committerGitHub <noreply@github.com>2023-01-16 16:21:06 +0800
commita90e324332bc99f9910f33ef08cc6c6e9fe9ada3 (patch)
treefe301e6857d0bb93ab6d2045985e1a14c09fd640 /nixos/tests
parente3da6738936720dc649927bccec826c5482ec653 (diff)
parentcd0e49f419451fe79e15b39d74f404fa5aa6eb97 (diff)
Merge pull request #210785 from fgaz/mindustry/nixos-test
nixosTests.mindustry: init; mindustry: use SRI hashes
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/mindustry.nix28
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 0dde27b8623a4..8227f606d1692 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -389,6 +389,7 @@ in {
   memcached = handleTest ./memcached.nix {};
   merecat = handleTest ./merecat.nix {};
   metabase = handleTest ./metabase.nix {};
+  mindustry = handleTest ./mindustry.nix {};
   minecraft = handleTest ./minecraft.nix {};
   minecraft-server = handleTest ./minecraft-server.nix {};
   minidlna = handleTest ./minidlna.nix {};
diff --git a/nixos/tests/mindustry.nix b/nixos/tests/mindustry.nix
new file mode 100644
index 0000000000000..b3f5423c601b3
--- /dev/null
+++ b/nixos/tests/mindustry.nix
@@ -0,0 +1,28 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "mindustry";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  nodes.machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    environment.systemPackages = [ pkgs.mindustry ];
+  };
+
+  enableOCR = true;
+
+  testScript =
+    ''
+      machine.wait_for_x()
+      machine.execute("mindustry >&2 &")
+      machine.wait_for_window("Mindustry")
+      # Loading can take a while. Avoid wasting cycles on OCR during that time
+      machine.sleep(60)
+      machine.wait_for_text(r"(Play|Database|Editor|Mods|Settings|Quit)")
+      machine.screenshot("screen")
+    '';
+})