about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2023-01-15 00:28:32 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2023-01-15 13:11:37 +0100
commitcbe58afca0bb3a28038284f678ba97707efa1b59 (patch)
treefc728328e889144e1bce88f6ba34655be19b587d /nixos
parent7f6757e4f2f6f68096988240940268dc4fd853d4 (diff)
nixosTests.mindustry: init
Diffstat (limited to 'nixos')
-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 acc42acf37a6a..541b7199afe5b 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")
+    '';
+})