Skip to content

Commit

Permalink
fix(test): set config yaml only if preset is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pbelmann committed Feb 2, 2024
1 parent fd73a9c commit b44d9c1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/workflow_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -192,15 +192,13 @@ 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
resources[flavorSize]["memory"] = ram
}
System.out.println("Flavor:" + flavorSize + ", CPUs:" + cpus + ", Memory:" + ram)
}

return resources
}

Expand Down
7 changes: 5 additions & 2 deletions scripts/test_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit b44d9c1

Please sign in to comment.