فهرست منبع

Merge pull request #278 from eza-community/cafk-itest-just

trycmd via just
Christina Sørensen 2 سال پیش
والد
کامیت
0733b36657
2فایلهای تغییر یافته به همراه21 افزوده شده و 1 حذف شده
  1. 20 0
      Justfile
  2. 1 1
      flake.nix

+ 20 - 0
Justfile

@@ -166,3 +166,23 @@ all-release: build-release test-release
     echo "```"
     md5sum ./target/"bin-$(convco version)"/*
     echo "```"
+
+#---------------------#
+# Integration testing #
+#---------------------#
+
+# Runs integration tests in nix sandbox
+#
+# Required nix, likely won't work on windows.
+@itest:
+    nix build -L ./#trycmd
+
+# Runs integration tests in nix sandbox, and dumps outputs.
+#
+# WARNING: this can cause loss of work
+@idump:
+    rm ./tests/cmd/*nix.stderr -f || echo  
+    rm ./tests/cmd/*nix.stdout -f || echo
+    nix build -L ./#trydump
+    cp ./result/dump/*nix.* ./tests/cmd/
+

+ 1 - 1
flake.nix

@@ -134,7 +134,7 @@
             # buildPhase files differ between dep and main phase
             singleStep = true;
             # set itests files creation date to unix epoch
-            buildPhase = ''touch --date=@0 tests/itest/*; rm tests/cmd/*.stdout; rm tests/cmd/*.stderr;'';
+            buildPhase = ''touch --date=@0 tests/itest/*; rm tests/cmd/*.stdout || echo; rm tests/cmd/*.stderr || echo;'';
             cargoTestOptions = opts: opts ++ [ "--features nix" ];
             TRYCMD="dump";
             postInstall = ''