nixosTests.nextflow: migrate to runTestOn (#399177)

authored by Pol Dellaiera and committed by GitHub 8d74a87f 0159ddab

+54 -56
+1 -1
nixos/tests/all-tests.nix
··· 885 885 # TODO: put in networking.nix after the test becomes more complete 886 886 networkingProxy = handleTest ./networking-proxy.nix { }; 887 887 nextcloud = handleTest ./nextcloud { }; 888 - nextflow = handleTestOn [ "x86_64-linux" ] ./nextflow.nix { }; 888 + nextflow = runTestOn [ "x86_64-linux" ] ./nextflow.nix; 889 889 nextjs-ollama-llm-ui = runTest ./web-apps/nextjs-ollama-llm-ui.nix; 890 890 nexus = handleTest ./nexus.nix { }; 891 891 # TODO: Test nfsv3 + Kerberos
+53 -55
nixos/tests/nextflow.nix
··· 1 - import ./make-test-python.nix ( 2 - { pkgs, ... }: 3 - let 4 - bash = pkgs.dockerTools.pullImage { 5 - imageName = "quay.io/nextflow/bash"; 6 - imageDigest = "sha256:bea0e244b7c5367b2b0de687e7d28f692013aa18970941c7dd184450125163ac"; 7 - sha256 = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5"; 8 - finalImageName = "quay.io/nextflow/bash"; 9 - }; 1 + { pkgs, ... }: 2 + let 3 + bash = pkgs.dockerTools.pullImage { 4 + imageName = "quay.io/nextflow/bash"; 5 + imageDigest = "sha256:bea0e244b7c5367b2b0de687e7d28f692013aa18970941c7dd184450125163ac"; 6 + sha256 = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5"; 7 + finalImageName = "quay.io/nextflow/bash"; 8 + }; 10 9 11 - hello = pkgs.stdenv.mkDerivation { 12 - name = "nextflow-hello"; 13 - src = pkgs.fetchFromGitHub { 14 - owner = "nextflow-io"; 15 - repo = "hello"; 16 - rev = "afff16a9b45c8e8a4f5a3743780ac13a541762f8"; 17 - hash = "sha256-c8FirHc+J5Y439g0BdHxRtXVrOAzIrGEKA0m1mp9b/U="; 18 - }; 19 - installPhase = '' 20 - cp -r $src $out 21 - ''; 10 + hello = pkgs.stdenv.mkDerivation { 11 + name = "nextflow-hello"; 12 + src = pkgs.fetchFromGitHub { 13 + owner = "nextflow-io"; 14 + repo = "hello"; 15 + rev = "afff16a9b45c8e8a4f5a3743780ac13a541762f8"; 16 + hash = "sha256-c8FirHc+J5Y439g0BdHxRtXVrOAzIrGEKA0m1mp9b/U="; 22 17 }; 23 - run-nextflow-pipeline = pkgs.writeShellApplication { 24 - name = "run-nextflow-pipeline"; 25 - runtimeInputs = [ pkgs.nextflow ]; 26 - text = '' 27 - export NXF_OFFLINE=true 28 - for b in false true; do 29 - echo "docker.enabled = $b" > nextflow.config 30 - cat nextflow.config 31 - nextflow run -ansi-log false ${hello} 32 - done 33 - ''; 34 - }; 35 - in 36 - { 37 - name = "nextflow"; 18 + installPhase = '' 19 + cp -r $src $out 20 + ''; 21 + }; 22 + run-nextflow-pipeline = pkgs.writeShellApplication { 23 + name = "run-nextflow-pipeline"; 24 + runtimeInputs = [ pkgs.nextflow ]; 25 + text = '' 26 + export NXF_OFFLINE=true 27 + for b in false true; do 28 + echo "docker.enabled = $b" > nextflow.config 29 + cat nextflow.config 30 + nextflow run -ansi-log false ${hello} 31 + done 32 + ''; 33 + }; 34 + in 35 + { 36 + name = "nextflow"; 38 37 39 - nodes.machine = 40 - { ... }: 41 - { 42 - environment.systemPackages = [ 43 - run-nextflow-pipeline 44 - pkgs.nextflow 45 - ]; 46 - virtualisation = { 47 - docker.enable = true; 48 - }; 38 + nodes.machine = 39 + { ... }: 40 + { 41 + environment.systemPackages = [ 42 + run-nextflow-pipeline 43 + pkgs.nextflow 44 + ]; 45 + virtualisation = { 46 + docker.enable = true; 49 47 }; 48 + }; 50 49 51 - testScript = 52 - { nodes, ... }: 53 - '' 54 - start_all() 55 - machine.wait_for_unit("docker.service") 56 - machine.succeed("docker load < ${bash}") 57 - machine.succeed("run-nextflow-pipeline >&2") 58 - ''; 59 - } 60 - ) 50 + testScript = 51 + { nodes, ... }: 52 + '' 53 + start_all() 54 + machine.wait_for_unit("docker.service") 55 + machine.succeed("docker load < ${bash}") 56 + machine.succeed("run-nextflow-pipeline >&2") 57 + ''; 58 + }