From 638f986f34f05376f586b65a2db8cf09c569fc70 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Wed, 6 Mar 2019 17:42:14 +0100 Subject: [PATCH 01/14] Adds profile integration tests --- .travis.yml | 28 ++++++++++++++++++++++++++++ conf/test_configs.config | 1 + nfcore_custom.config | 1 + 3 files changed, 30 insertions(+) create mode 100644 .travis.yml create mode 100644 conf/test_configs.config diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6824033 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +sudo: required +language: python +jdk: openjdk8 +services: + - docker +python: + - '3.6' +cache: pip +matrix: + fast_finish: true + +before_install: + # PRs to master are only ok if coming from dev branch + - '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])' + +install: + # Install Nextflow + - mkdir /tmp/nextflow && cd /tmp/nextflow + - wget -qO- get.nextflow.io | bash + - sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow + +env: + - NXF_VER='18.10.1' # Specify a minimum NF version that should be tested and work + - NXF_VER='' # Plus: get the latest NF version and check, that it works + +script: + # Run the pipeline with the test profile and test remote config + - nextflow run nf-core/hlatyping -profile test_configs,test,docker \ No newline at end of file diff --git a/conf/test_configs.config b/conf/test_configs.config new file mode 100644 index 0000000..7c6c340 --- /dev/null +++ b/conf/test_configs.config @@ -0,0 +1 @@ +// Empty config for integration test purposes. \ No newline at end of file diff --git a/nfcore_custom.config b/nfcore_custom.config index 86532cd..cc29636 100644 --- a/nfcore_custom.config +++ b/nfcore_custom.config @@ -22,6 +22,7 @@ profiles { munin { includeConfig "${params.custom_config_base}/munin.config" } phoenix { includeConfig "${params.custom_config_base}/phoenix.config" } shh { includeConfig "${params.custom_config_base}/shh.config" } + test_configs { includeConfig "${params.custom_config_base}/test_configs.config"} uct_hex { includeConfig "${params.custom_config_base}/uct_hex.config" } uppmax_devel { includeConfig "${params.custom_config_base}/uppmax.config" includeConfig "${params.custom_config_base}/uppmax-devel.config" From 7ec2532b78306690405af2d1a85ac2beea7213c4 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Wed, 6 Mar 2019 17:58:43 +0100 Subject: [PATCH 02/14] Points config version to current branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6824033..3448ea6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run nf-core/hlatyping -profile test_configs,test,docker \ No newline at end of file + - nextflow run nf-core/hlatyping --custom_config_version $TRAVIS_BRANCH -profile test_configs,test,docker \ No newline at end of file From fe9d85b23c2dde3955b67f450c0fa44ea7adc627 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Wed, 6 Mar 2019 18:20:56 +0100 Subject: [PATCH 03/14] Fixes unresolved var --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3448ea6..68a8fa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run nf-core/hlatyping --custom_config_version $TRAVIS_BRANCH -profile test_configs,test,docker \ No newline at end of file + - nextflow run nf-core/hlatyping --custom_config_version ${TRAVIS_BRANCH} -profile test_configs,test,docker \ No newline at end of file From dcc2680ad59e8137266cc92816349294512a62ae Mon Sep 17 00:00:00 2001 From: Sven F Date: Wed, 6 Mar 2019 18:32:14 +0100 Subject: [PATCH 04/14] Uses checked out config version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 68a8fa1..e42b0d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run nf-core/hlatyping --custom_config_version ${TRAVIS_BRANCH} -profile test_configs,test,docker \ No newline at end of file + - nextflow run nf-core/hlatyping --custom_config_base ${TRAVIS_BUILD_DIR} -profile test_configs,test,docker From af810055635a8f5689fb58855cf1eb2b3d5359c8 Mon Sep 17 00:00:00 2001 From: Sven F Date: Wed, 6 Mar 2019 19:51:03 +0100 Subject: [PATCH 05/14] Uses dev branch for now --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e42b0d6..11d895e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run nf-core/hlatyping --custom_config_base ${TRAVIS_BUILD_DIR} -profile test_configs,test,docker + - nextflow run nf-core/hlatyping -r dev --custom_config_base ${TRAVIS_BUILD_DIR} -profile test_configs,test,docker From da1b4572d30e6fcbe147bcef035f23115b93e6ba Mon Sep 17 00:00:00 2001 From: Sven F Date: Wed, 6 Mar 2019 20:11:20 +0100 Subject: [PATCH 06/14] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 11d895e..2958db8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ install: - mkdir /tmp/nextflow && cd /tmp/nextflow - wget -qO- get.nextflow.io | bash - sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow + - mkdir -p ${TRAVIS_BUILD_DIR}/tests && cd ${TRAVIS_BUILD_DIR}/tests env: - NXF_VER='18.10.1' # Specify a minimum NF version that should be tested and work From 4e1cb46dc5a10d16360ceae55b3f848893f7d35b Mon Sep 17 00:00:00 2001 From: Sven F Date: Wed, 6 Mar 2019 20:22:45 +0100 Subject: [PATCH 07/14] Update nfcore_custom.config --- nfcore_custom.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfcore_custom.config b/nfcore_custom.config index e7d1923..8390b23 100644 --- a/nfcore_custom.config +++ b/nfcore_custom.config @@ -22,7 +22,7 @@ profiles { munin { includeConfig "${params.custom_config_base}/conf/munin.config" } phoenix { includeConfig "${params.custom_config_base}/conf/phoenix.config" } shh { includeConfig "${params.custom_config_base}/conf/shh.config" } - test_configs { includeConfig "${params.custom_config_base}/test_configs.config"} + test_configs { includeConfig "${params.custom_config_base}/conf/test_configs.config"} uct_hex { includeConfig "${params.custom_config_base}/conf/uct_hex.config" } uppmax_devel { includeConfig "${params.custom_config_base}/conf/uppmax.config" includeConfig "${params.custom_config_base}/conf/uppmax-devel.config" From 4d43077ddf7dccf7b17650d58eefc28fdfcdf596 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 10:36:03 +0100 Subject: [PATCH 08/14] Adds simple NXF config script --- configtest.nf | 10 ++++++++++ nextflow.config | 1 + 2 files changed, 11 insertions(+) create mode 100644 configtest.nf create mode 100644 nextflow.config diff --git a/configtest.nf b/configtest.nf new file mode 100644 index 0000000..39badec --- /dev/null +++ b/configtest.nf @@ -0,0 +1,10 @@ +#!/usr/bin/env nextflow + +def separator = "-"*40 +print("$separator\n") +print("Parameter scope for config \'${workflow.profile}\'\n") +print("$separator\n") +params.each { + assert it + print("\t$it\n") +} \ No newline at end of file diff --git a/nextflow.config b/nextflow.config new file mode 100644 index 0000000..f1ffe8a --- /dev/null +++ b/nextflow.config @@ -0,0 +1 @@ +includeConfig("nfcore_custom.config") \ No newline at end of file From 1dc523d726fd5baedf4585fbc6165aa3e2dc07d4 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 10:37:27 +0100 Subject: [PATCH 09/14] Removes test config --- .travis.yml | 2 +- conf/test_configs.config | 1 - nfcore_custom.config | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 conf/test_configs.config diff --git a/.travis.yml b/.travis.yml index 2958db8..2b37dd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run nf-core/hlatyping -r dev --custom_config_base ${TRAVIS_BUILD_DIR} -profile test_configs,test,docker + - nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile diff --git a/conf/test_configs.config b/conf/test_configs.config deleted file mode 100644 index 7c6c340..0000000 --- a/conf/test_configs.config +++ /dev/null @@ -1 +0,0 @@ -// Empty config for integration test purposes. \ No newline at end of file diff --git a/nfcore_custom.config b/nfcore_custom.config index 8390b23..dfcb4d2 100644 --- a/nfcore_custom.config +++ b/nfcore_custom.config @@ -22,7 +22,6 @@ profiles { munin { includeConfig "${params.custom_config_base}/conf/munin.config" } phoenix { includeConfig "${params.custom_config_base}/conf/phoenix.config" } shh { includeConfig "${params.custom_config_base}/conf/shh.config" } - test_configs { includeConfig "${params.custom_config_base}/conf/test_configs.config"} uct_hex { includeConfig "${params.custom_config_base}/conf/uct_hex.config" } uppmax_devel { includeConfig "${params.custom_config_base}/conf/uppmax.config" includeConfig "${params.custom_config_base}/conf/uppmax-devel.config" From 7962f7d7563c8d97d11267d614bb6cc51fd3178e Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 10:52:09 +0100 Subject: [PATCH 10/14] Iterates over profiles and calls Nextflow --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2b37dd4..6a640b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile + - grep -o "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | sed 's/.config\"//g' | cat | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -{} From e40176969891dd0218c7ce3c22068acf964b0f31 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 10:54:41 +0100 Subject: [PATCH 11/14] Corrects NXF command line call --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6a640b8..8e413e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - grep -o "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | sed 's/.config\"//g' | cat | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -{} + - grep -o "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | sed 's/.config\"//g' | cat | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} From d4cd9b1f0a2dd5be514e2c52affc6474556e2c19 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 11:58:37 +0100 Subject: [PATCH 12/14] Corrects profile grep --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8e413e6..0760514 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - grep -o "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | sed 's/.config\"//g' | cat | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} + - grep "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | | tr -s ' ' | cut -d " " -f 2 | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} From bbe0d304629d8fe601f754684eab653884ff43d7 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 12:00:43 +0100 Subject: [PATCH 13/14] Fixes syntax error in travis script --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0760514..6d1f42e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - grep "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | | tr -s ' ' | cut -d " " -f 2 | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} + - grep "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | tr -s ' ' | cut -d " " -f 2 | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} From ba3d221af62bdf7f27fb33bacaba6cdef1930948 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Fri, 8 Mar 2019 12:23:27 +0100 Subject: [PATCH 14/14] Corrects regex --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d1f42e..b200b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ env: script: # Run the pipeline with the test profile and test remote config - - grep "[a-z]*.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | tr -s ' ' | cut -d " " -f 2 | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {} + - grep "{.*includeConfig.*[a-z]*\.config\"" ${TRAVIS_BUILD_DIR}/nfcore_custom.config | tr -s ' ' | cut -d " " -f 2 | xargs -I {} nextflow run ${TRAVIS_BUILD_DIR}/configtest.nf -profile {}