Commit f4a97dc8 authored by Valentin Reis's avatar Valentin Reis

Test indinection architecture draft.

parent a5d861e1
Pipeline #4837 failed
stages:
- test
integration.test:
locally-sourced-tests.test:
stage: test
script:
- nix-shell -A test --run "argotk.hs tests"
......@@ -15,3 +15,17 @@ integration.test:
- _output/.argo_nodeos_config_exit_message
tags:
- integration
all-test-provenances.test:
stage: test
script:
- nix-build -A test-list
except:
- /^wip\/.*/
- /^WIP\/.*/
artifacts:
when: always
paths:
result
tags:
- integration
......@@ -111,4 +111,26 @@ in rec
inherit shellHook;
MANIFESTS = ./manifests;
};
test-list =
let
showSource = s: pkgs.runCommand "source" {} "echo '${builtins.toJSON s}' | ${pkgs.jq}/bin/jq > $out";
tests = import ./tests/default.nix {};
showTest = name: content: ''
##### TEST NAME: ${name} #####
argotest: source with type ${content.argotest.type} pointing to ${content.argotest.rev}". Detailed source info:
${builtins.readFile (showSource content.argotest.args)}
nrm: source with type ${content.nrm.type} pointing to ${content.nrm.rev}". Detailed source info:
${builtins.readFile (showSource content.nrm.args)}
libnrm: source with type ${content.libnrm.type} pointing to ${content.libnrm.rev}". Detailed source info:
${builtins.readFile (showSource content.libnrm.args)}
containers: source with type ${content.containers.type} pointing to ${content.containers.rev}". Detailed source info:
${builtins.readFile (showSource content.containers.args)}
'';
in pkgs.writeText "test-list" (''
Available test provenance configurations:
''+(builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList showTest tests)));
#testsRepresentations = pkgs.lib.mapAttrsToList (name: value: name ) tests;
#output = builtins.concatStringsSep "\n" testsRepresentations;
}
#!/bin/sh
echo "Warning. This is going to download all test sources, and build them."
cat $(nix-build -A test-list)
{ pkgs ? import <nixpkgs> {},
testName ? "base"
}:
let
testEnv = spec: (import spec.argotest.src {
nrm-src=spec.nrm.src;
libnrm-src=spec.libnrm.src;
containers-src=spec.containers.src;
}).test ;
allTests = import ./tests/default.nix {};
in testEnv allTests."${testName}"
{ pkgs ? import <nixpkgs> {} }:
#This file configures the test index
let
fullJsonTestSpec = basename: d: _:
{
argotest = pkgs.nix-update-source.fetch "${basename}/${d}/argotest.json";
nrm = pkgs.nix-update-source.fetch "${basename}/${d}/nrm.json";
libnrm = pkgs.nix-update-source.fetch "${basename}/${d}/libnrm.json";
containers = pkgs.nix-update-source.fetch "${basename}/${d}/containers.json";
};
getSpec = d: builtins.mapAttrs (fullJsonTestSpec d) (builtins.readDir d);
in
(getSpec ./fulljson) //
{
}
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "3473ba52fe544d9130b4c330561c5a138fcd70b2",
"sha256": "1h611nnqifpwl1n82kchn2d2qcd7jb7b646vl9dyn23h2fhzjd7l",
"url": "https://xgitlab.cels.anl.gov/argo/argotest.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/master",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/argotest.git"
}
\ No newline at end of file
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "3e8a8ca82e223d0d7f713027fdfd35289e0ef89b",
"sha256": "1h2alkay1q7hmw1fq7y37v8fr44dv0r23qnjjdmz1ra3c28b1xq0",
"url": "https://xgitlab.cels.anl.gov/argo/containers.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/master",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/containers.git"
}
\ No newline at end of file
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "c81c458de93a353a7b5ba19cd124c02ed8ee85f3",
"sha256": "07f9ilxabxfs8iy0l7lq5788lqfrc6ckghdfxxaziiyqav90ayf0",
"url": "https://xgitlab.cels.anl.gov/argo/libnrm.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/master",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/libnrm.git"
}
\ No newline at end of file
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "af621b32a4ee98f65db13ab348c6a9a266ee2ebe",
"sha256": "06nnajpc107ga1pmsin4ly6ghvg2xcqzzk658x4f7dh9cl5rcyk0",
"url": "https://xgitlab.cels.anl.gov/argo/nrm.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/master",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/nrm.git"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment