From 50f9897c2e0b31271d2e501e8f0447d8f7e3c45c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 4 Jul 2020 16:17:20 +0800 Subject: [PATCH] use new technique to access network from Hydra tests --- artiq-fast.nix | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/artiq-fast.nix b/artiq-fast.nix index 92bf6ea..8989d12 100644 --- a/artiq-fast.nix +++ b/artiq-fast.nix @@ -31,13 +31,6 @@ let echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX\"" > $out/pkgs/artiq-version.nix echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix ''; - generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; } - '' - TMPDIR=`mktemp -d` - cp ${generatedNix}/pkgs/artiq-version.nix $TMPDIR/passed - HASH=`nix-hash --type sha256 --base32 $TMPDIR` - echo \"$HASH\" > $out - ''; artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; }; artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix" (with pkgs; { inherit stdenv fetchgit git; }); windowsRunner = overrides: @@ -63,18 +56,11 @@ in ''; }; - # HACK: Abuse fixed-output derivations to escape the sandbox and run the hardware - # unit tests, all integrated in the Hydra interface. - # One major downside of this hack is the tests are only run when generateTestOkHash - # changes, i.e. when the ARTIQ version changes (and not the dependencies). - # Impure derivations, when they land in Nix/Hydra, should improve the situation. extended-tests = pkgs.stdenv.mkDerivation { name = "extended-tests"; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = import generateTestOkHash; - __hydraRetry = false; + # requires patched Nix + __networked = true; buildInputs = [ (pkgs.python3.withPackages(ps: [ ps.paramiko artiqpkgs.artiq artiqpkgs.artiq-board-kc705-nist_clock ])) @@ -119,8 +105,7 @@ in ${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\Anaconda3\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&& python -m unittest discover -v artiq.test.coredevice"; }}/bin/wfvm-run-windows-tests ) - mkdir $out - cp ${generatedNix}/pkgs/artiq-version.nix $out/passed + touch $out ''; }; }