From b44d9c1b3557c06240ea612bdb8f4d5d8ea1b4c3 Mon Sep 17 00:00:00 2001 From: Peter Belmann Date: Fri, 2 Feb 2024 09:00:19 +0000 Subject: [PATCH] fix(test): set config yaml only if preset is disabled --- .github/workflows/workflow_modules.yml | 5 +++-- Makefile | 11 ++++++++++- nextflow.config | 4 +--- scripts/test_settings.sh | 7 +++++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow_modules.yml b/.github/workflows/workflow_modules.yml index e1c35e25..1af95a86 100644 --- a/.github/workflows/workflow_modules.yml +++ b/.github/workflows/workflow_modules.yml @@ -442,14 +442,15 @@ jobs: OUTPUT=outputEasy bash ./scripts/test_settings.sh \ " --preset --scratch /vol/scratch --input.paired.path test_data/fullPipeline/reads_split.tsv --highmemLarge=28,2000 --s3SignIn false --databases=/vol/scratch/databases/ --output=${OUTPUT} " \ - "" "${WORK_DIR}" ${PROFILE} ${VERSION} || exit 1 + " " "${WORK_DIR}" ${PROFILE} ${VERSION} "preset" || exit 1 + bash ./scripts/check_parameter.sh ${OUTPUT} || exit 1 - name: Test whether settings in default mode can be updated run: | VERSION=$(sort VERSIONS.txt | tail -n 1) OUTPUT=outputDefault bash ./scripts/test_settings.sh \ " --scratch /vol/scratch --resources.highmemLarge.memory=2000 --s3SignIn false --databases=/vol/scratch/databases/ --output=${OUTPUT} " \ - "" "${WORK_DIR}" ${PROFILE} ${VERSION} || exit 1 + " -params-file /example_params/fullPipeline.yml " "${WORK_DIR}" ${PROFILE} ${VERSION} "" || exit 1 bash ./scripts/check_parameter.sh ${OUTPUT} || exit 1 diff --git a/Makefile b/Makefile index 7e2a707a..d74f15c2 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,15 @@ ifndef PARAMS_FILE override PARAMS_FILE = ${CURRENT_DIR}/example_params/fullPipeline.yml endif +ifdef PRESET + override PARAMS_FILE="" +endif + +ifneq (${PARAMS_FILE}, "") + override PARAMS_COMMAND = -params-file ${PARAMS_FILE} +endif + + ifndef BRANCH override BRANCH = "dev" endif @@ -126,7 +135,7 @@ set_secrets: nextflow ## Set secrets for sensitive data access NXF_HOME=$$PWD/.nextflow ./nextflow secrets set ${SECRET_NAME} ${SECRET_VALUE} run_small_full_test: nextflow ## Prepares input files like downloading bins and reads and executes Nextflow. The default configuration it runs the full pipeline locally. - NXF_HOME=$$PWD/.nextflow ./nextflow run main.nf ${OPTIONS} -work-dir ${WORK_DIR} -profile ${PROFILE} -resume -entry ${ENTRY} -params-file ${PARAMS_FILE} --logDir ${LOG_DIR} ; exit $$? + NXF_HOME=$$PWD/.nextflow ./nextflow run main.nf ${OPTIONS} -work-dir ${WORK_DIR} -profile ${PROFILE} -resume -entry ${ENTRY} ${PARAMS_COMMAND} --logDir ${LOG_DIR} ; exit $$? help: ## Lists available Makefile commands diff --git a/nextflow.config b/nextflow.config index 682bf207..c85ffe5c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -180,7 +180,7 @@ def getPresetInput(){ * */ def getPresetResources(){ - resources = preLoadYML["resources"] + def resources = preLoadYML["resources"] System.out.println(PRETTY_SEPARATOR) System.out.println("The following job flavors are defined:\n") @@ -192,7 +192,6 @@ def getPresetResources(){ ram = resources[flavorSize]["memory"] if(params.containsKey(flavorSize)){ - cpus = params[flavorSize].split(",")[CPUS_KEY] as Integer ram = params[flavorSize].split(",")[MEMORY_KEY] as Integer resources[flavorSize]["cpus"] = cpus @@ -200,7 +199,6 @@ def getPresetResources(){ } System.out.println("Flavor:" + flavorSize + ", CPUs:" + cpus + ", Memory:" + ram) } - return resources } diff --git a/scripts/test_settings.sh b/scripts/test_settings.sh index e73417dd..686cbdb8 100644 --- a/scripts/test_settings.sh +++ b/scripts/test_settings.sh @@ -2,16 +2,19 @@ set -e ENTRY="wSaveSettings" OPTIONS=$1 -YAML="${2:-example_params/fullPipeline.yml}" +YAML="$2" WORK="${3:-work}_${ENTRY}" PROFILE="${4:-standard}" VERSION="${5:-}" +PRESET="${6:-}" LOG_DIR="${WORK}/logs" make run_small_full_test WORK_DIR=${WORK} \ - PARAMS_FILE=$YAML \ + PARAMS_FILE="$YAML" \ + PRESET="${PRESET}" \ LOG_DIR=${LOG_DIR} \ PROFILE="$PROFILE" \ OPTIONS=" $OPTIONS " \ ENTRY="${ENTRY}" \ VERSION="$VERSION" +make check LOG_DIR=${LOG_DIR}