let tools_workflow =
  let tools_to_test = 
    let open Biokepi.Machine.Tool.Default in
    let which_size_and bin  l =
      ("which " ^ bin)
      :: ("ls -l $(which " ^ bin ^ ")")
      :: ("file $(which " ^ bin ^ ")")
      :: l in
    [
      bwa,       which_size_and "bwa" ["bwa || echo Done"];
      stringtie, which_size_and "stringtie" [ "stringtie --help"];
      bedtools,  which_size_and "bedtools" [ "bedtools --help"];
      vcftools,  which_size_and "vcftools" [ "vcftools --help"];
      (* TODO: Mosaik's installation is still broken
      mosaik,    which_size_and "MosaikAligner"
        ["MosaikAligner --help";
         "ls -l \"$MOSAIK_PE_ANN\"";
         "ls -l \"$MOSAIK_SE_ANN\""; ];
         *)

      star,    which_size_and "STAR" []; (* STAR does not work on OSX, can't
                                            find a command that exits with 0*)

      hisat,   which_size_and "hisat" ["hisat --help"]; (* hisat does not work on OSX*)
      hisat2,  which_size_and "hisat2" ["hisat2 --help"]; (* hisat does not work on OSX*)
      kallisto, which_size_and "kallisto" ["kallisto version"]; (* kallisto does not work on OSX*)
      samtools, which_size_and "samtools" ["samtools --help"];
      samtools, which_size_and "bgzip" ["bgzip --help || echo OK"]; (* tool returns 1 on --help *)
      samtools, which_size_and "tabix" ["tabix --help || echo OK"]; (* idem. *)
      varscan, ["ls -l \"$VARSCAN_JAR\"""java -jar $VARSCAN_JAR -help"];
      picard, ["ls -l \"$PICARD_JAR\""]; (*
              "java -jar $PICARD_JAR --help" gave the epic:
          "'--help' is not a valid command. See PicardCommandLine --help for more information"
            *)

      strelka, ["ls -l \"$STRELKA_BIN\"";
                "perl -c $STRELKA_BIN/configureStrelkaWorkflow.pl"];
      virmid, ["ls -l \"$VIRMID_JAR\"""java -jar $VIRMID_JAR -help"];
      muse, which_size_and "$muse_bin" ["$muse_bin call -h"];
      (* muse call -h displays an error but still returns 0 *)
      somaticsniper, which_size_and "somaticsniper" ["somaticsniper -v"];
      seq2hla, which_size_and "seq2HLA" ["seq2HLA --version"];
      optitype, which_size_and "OptiTypePipeline" ["OptiTypePipeline -h"];
      ledit_def,  which_size_and "ledit" ["ledit -v"];
      biocaml_def, ["ocamlfind list | grep biocaml"];
     ]
  in
  let open Ketrew.EDSL in
  let edges =
    List.map tools_to_test ~f:(fun (def, cmds) ->
        let tool = Biokepi.Machine.Tool.Kit.get_exn toolkit def in
        workflow_node without_product
          ~name:(sprintf "Test tool %s: %S, …"
                   (Biokepi.Machine.Tool.Definition.to_string def)
                   (List.hd_exn cmds))
          ~make:(run_program Program.(
              Biokepi.Machine.Tool.init tool
              && chain (List.map cmds ~f:sh)
            ))
          ~edges:[
            depends_on Biokepi.Machine.Tool.(ensure tool)
          ]
        |> depends_on
      )
  in
  workflow_node without_product ~name:"All tool installations" ~edges