diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 059e7eb65e1733e1e69fe80cbd1671759968892e..3bbf86b6caa596d4f496f54c55b0fae6bc0914eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ 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 diff --git a/default.nix b/default.nix index b58e9658276ac5324f2fd4b163a34b1b6feaa73a..c4076e79cf205b7d4a749bf99b550cf31b29ff18 100644 --- a/default.nix +++ b/default.nix @@ -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; } diff --git a/list-tests.sh b/list-tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..c0715fa44237ac71c47cce0600eee726e3eabeee --- /dev/null +++ b/list-tests.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Warning. This is going to download all test sources, and build them." + +cat $(nix-build -A test-list) diff --git a/test.nix b/test.nix new file mode 100644 index 0000000000000000000000000000000000000000..6f7e0fde9e47f1a7d1b6aa444977931b659d91e2 --- /dev/null +++ b/test.nix @@ -0,0 +1,11 @@ +{ pkgs ? import {}, + 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}" diff --git a/tests/default.nix b/tests/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..fd0602545e66e12e3983df339f2e12bfbb5a3f59 --- /dev/null +++ b/tests/default.nix @@ -0,0 +1,17 @@ +{ pkgs ? import {} }: +#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) // + { + } diff --git a/tests/fulljson/base/argotest.json b/tests/fulljson/base/argotest.json new file mode 100644 index 0000000000000000000000000000000000000000..21625ab26a4eaa564bb06c284bd899e4e3abf00e --- /dev/null +++ b/tests/fulljson/base/argotest.json @@ -0,0 +1,14 @@ +{ + "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 diff --git a/tests/fulljson/base/containers.json b/tests/fulljson/base/containers.json new file mode 100644 index 0000000000000000000000000000000000000000..fb1cb119b0e915aa8c6f6b8c64667d8e6c41eb6d --- /dev/null +++ b/tests/fulljson/base/containers.json @@ -0,0 +1,14 @@ +{ + "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 diff --git a/tests/fulljson/base/libnrm.json b/tests/fulljson/base/libnrm.json new file mode 100644 index 0000000000000000000000000000000000000000..128686ca2af01bed4603a1a348af3a3449df7edf --- /dev/null +++ b/tests/fulljson/base/libnrm.json @@ -0,0 +1,14 @@ +{ + "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 diff --git a/tests/fulljson/base/nrm.json b/tests/fulljson/base/nrm.json new file mode 100644 index 0000000000000000000000000000000000000000..aa4671022b94e0903658049e5da8f2875d587649 --- /dev/null +++ b/tests/fulljson/base/nrm.json @@ -0,0 +1,14 @@ +{ + "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