From a82f0f5f4806f47d4a952b0f726b592b18debabb Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 11 Dec 2020 13:26:09 +0100 Subject: [PATCH] add test 'pkgsUnstable' Included in 'basic' tests. Function 'doBuild' is needed by the following commit. --- test/pkgs-unstable.nix | 13 +++++++++++++ test/run-tests.sh | 27 ++++++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 test/pkgs-unstable.nix diff --git a/test/pkgs-unstable.nix b/test/pkgs-unstable.nix new file mode 100644 index 0000000..3ad8583 --- /dev/null +++ b/test/pkgs-unstable.nix @@ -0,0 +1,13 @@ +let + pinned = import ../pkgs/nixpkgs-pinned.nix; + pkgs = import pinned.nixpkgs-unstable {}; + nbPkgs = import ../pkgs { inherit pkgs; }; + pkgsUnstable = with nbPkgs; [ + electrs + elementsd + hwi + joinmarket + lightning-loop + ]; +in +pkgs.writeText "pkgs-unstable" (pkgs.lib.concatMapStringsSep "\n" toString pkgsUnstable) diff --git a/test/run-tests.sh b/test/run-tests.sh index 0d9eba5..7703fa9 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -132,14 +132,20 @@ container() { . "$scriptDir/lib/make-container.sh" "$@" } +doBuild() { + name=$1 + shift + if [[ $outLinkPrefix ]]; then + outLink="--out-link $outLinkPrefix-$name" + else + outLink=--no-out-link + fi + nix-build $outLink "$@" +} + # Run the test by building the test derivation buildTest() { - if [[ $outLinkPrefix ]]; then - buildArgs="--out-link $outLinkPrefix-$scenario" - else - buildArgs=--no-out-link - fi - vmTestNixExpr | nix-build $buildArgs "$@" - + vmTestNixExpr | doBuild $scenario $outLinkArg "$@" - } # On continuous integration nodes there are few other processes running alongside the @@ -172,6 +178,10 @@ vmTestNixExpr() { EOF } +pkgsUnstable() { + doBuild pkgs-unstable "$scriptDir/pkgs-unstable.nix" +} + # A basic subset of tests to keep the total runtime within # manageable bounds (<4 min on desktop systems). # These are also run on the CI server. @@ -179,14 +189,13 @@ basic() { scenario=default buildTest "$@" scenario=netns buildTest "$@" scenario=netnsRegtest buildTest "$@" + pkgsUnstable } all() { - scenario=default buildTest "$@" - scenario=netns buildTest "$@" + basic scenario=full buildTest "$@" scenario=regtest buildTest "$@" - scenario=netnsRegtest buildTest "$@" } # An alias for buildTest