From eef633c1cc15392a43a8e950599b039091a78a9a Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 15 Jan 2022 13:17:25 -0500 Subject: [PATCH] tests: create a declarative project spec and the autoconfig machinery --- .gitignore | 1 + configure.ac | 6 +++++- t/jobs/declarative/project.json.in | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 t/jobs/declarative/project.json.in diff --git a/.gitignore b/.gitignore index f4c2ae30..799db665 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ Makefile.in /t/nix /t/data /t/jobs/config.nix +t/jobs/declarative/project.json /inst hydra-config.h hydra-config.h.in diff --git a/configure.ac b/configure.ac index 9a32651e..0c823696 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ then NIX_STATE_DIR="$TMPDIR" export NIX_STATE_DIR fi -if NIX_REMOTE=daemon PAGER=cat "$NIX_STORE_PROGRAM" --timeout 123 -q; then +if NIX_REMOTE=daemon PAGER=cat "$NIX_STORE_PROGRAM" --timeout 123 -q; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -55,6 +55,9 @@ PKG_CHECK_MODULES([NIX], [nix-main nix-expr nix-store]) testPath="$(dirname $(type -p expr))" AC_SUBST(testPath) +jobsPath="$(realpath ./t/jobs)" +AC_SUBST(jobsPath) + CXXFLAGS+=" -include nix/config.h" AC_CONFIG_FILES([ @@ -72,6 +75,7 @@ AC_CONFIG_FILES([ src/script/Makefile t/Makefile t/jobs/config.nix + t/jobs/declarative/project.json ]) AC_CONFIG_COMMANDS([executable-scripts], []) diff --git a/t/jobs/declarative/project.json.in b/t/jobs/declarative/project.json.in new file mode 100644 index 00000000..3f846863 --- /dev/null +++ b/t/jobs/declarative/project.json.in @@ -0,0 +1,24 @@ +{ + "enabled": 1, + "hidden": false, + "description": "declarative-jobset-example", + "nixexprinput": "src", + "nixexprpath": "declarative/generator.nix", + "checkinterval": 300, + "schedulingshares": 100, + "enableemail": false, + "emailoverride": "", + "keepnr": 3, + "inputs": { + "src": { + "type": "path", + "value": "@jobsPath@", + "emailresponsible": false + }, + "jobspath": { + "type": "string", + "value": "@jobsPath@", + "emailresponsible": false + } + } +}