From b2dbaa99309a2057efc32ef9d029ed91140068df Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Wed, 11 May 2022 17:32:50 +0200 Subject: [PATCH] refactor: rename module --- .../main.nf | 2 +- .../meta.yml | 2 +- .../templates/detect_ncbi_settings.sh | 0 tests/config/pytest_modules.yml | 8 ++-- tests/modules/custom/ncbisettings/test.yml | 44 ------------------- .../main.nf | 14 +++--- .../nextflow.config | 0 .../nextflow_mount.config | 2 +- .../custom/sratoolsncbisettings/test.yml | 44 +++++++++++++++++++ 9 files changed, 58 insertions(+), 58 deletions(-) rename modules/custom/{ncbisettings => sratoolsncbisettings}/main.nf (94%) rename modules/custom/{ncbisettings => sratoolsncbisettings}/meta.yml (95%) rename modules/custom/{ncbisettings => sratoolsncbisettings}/templates/detect_ncbi_settings.sh (100%) delete mode 100644 tests/modules/custom/ncbisettings/test.yml rename tests/modules/custom/{ncbisettings => sratoolsncbisettings}/main.nf (75%) rename tests/modules/custom/{ncbisettings => sratoolsncbisettings}/nextflow.config (100%) rename tests/modules/custom/{ncbisettings => sratoolsncbisettings}/nextflow_mount.config (91%) create mode 100644 tests/modules/custom/sratoolsncbisettings/test.yml diff --git a/modules/custom/ncbisettings/main.nf b/modules/custom/sratoolsncbisettings/main.nf similarity index 94% rename from modules/custom/ncbisettings/main.nf rename to modules/custom/sratoolsncbisettings/main.nf index f3015c74..21bf3005 100644 --- a/modules/custom/ncbisettings/main.nf +++ b/modules/custom/sratoolsncbisettings/main.nf @@ -1,4 +1,4 @@ -process SRATOOLS_NCBISETTINGS { +process CUSTOM_SRATOOLSNCBISETTINGS { tag 'ncbi-settings' label 'process_low' diff --git a/modules/custom/ncbisettings/meta.yml b/modules/custom/sratoolsncbisettings/meta.yml similarity index 95% rename from modules/custom/ncbisettings/meta.yml rename to modules/custom/sratoolsncbisettings/meta.yml index 6043ece4..01e98856 100644 --- a/modules/custom/ncbisettings/meta.yml +++ b/modules/custom/sratoolsncbisettings/meta.yml @@ -1,4 +1,4 @@ -name: "sratools_ncbisettings" +name: "sratoolsncbisettings" description: Test for the presence of suitable NCBI settings or create them on the fly. keywords: - NCBI diff --git a/modules/custom/ncbisettings/templates/detect_ncbi_settings.sh b/modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh similarity index 100% rename from modules/custom/ncbisettings/templates/detect_ncbi_settings.sh rename to modules/custom/sratoolsncbisettings/templates/detect_ncbi_settings.sh diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4a922a4d..428c3652 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -495,6 +495,10 @@ custom/getchromsizes: - modules/custom/getchromsizes/** - tests/modules/custom/getchromsizes/** +custom/sratoolsncbisettings: + - modules/custom/sratoolsncbisettings/** + - tests/modules/custom/sratoolsncbisettings/** + cutadapt: - modules/cutadapt/** - tests/modules/cutadapt/** @@ -1819,10 +1823,6 @@ sratools/fasterqdump: - modules/sratools/fasterqdump/** - tests/modules/sratools/fasterqdump/** -sratools/ncbisettings: - - modules/sratools/ncbisettings/** - - tests/modules/sratools/ncbisettings/** - sratools/prefetch: - modules/sratools/prefetch/** - tests/modules/sratools/prefetch/** diff --git a/tests/modules/custom/ncbisettings/test.yml b/tests/modules/custom/ncbisettings/test.yml deleted file mode 100644 index 891ebb58..00000000 --- a/tests/modules/custom/ncbisettings/test.yml +++ /dev/null @@ -1,44 +0,0 @@ -- name: "sratools ncbisettings test_sratools_ncbisettings_with_good_existing" - command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_good_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow_mount.config - tags: - - "sratools" - - "sratools/ncbisettings" - files: - - path: "output/sratools/user-settings.mkfg" - md5sum: 955e27aff2c277c2f1f0943a098888c1 - - path: output/sratools/versions.yml - contains: - - "sratools: 2.11.0" - -- name: "sratools ncbisettings test_sratools_ncbisettings_with_bad_existing" - command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_bad_existing -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow_mount.config - tags: - - "sratools" - - "sratools/ncbisettings" - exit_code: 1 - stdout: - contains: - - "Command error:" - - "missing the required entries" - - "/LIBS/GUID" - - "/libs/cloud/report_instance_identity" - - "Feel free to add the following" - files: - - path: "output/sratools/user-settings.mkfg" - should_exist: false - - path: output/sratools/versions.yml - should_exist: false - -- name: "sratools ncbisettings test_sratools_ncbisettings_with_nonexisting" - command: nextflow run ./tests/modules/sratools/ncbisettings -entry test_sratools_ncbisettings_with_nonexisting -c ./tests/config/nextflow.config -c ./tests/modules/sratools/ncbisettings/nextflow.config - tags: - - "sratools" - - "sratools/ncbisettings" - files: - - path: "output/sratools/user-settings.mkfg" - contains: - - "/LIBS/GUID" - - "/libs/cloud/report_instance_identity" - - path: output/sratools/versions.yml - contains: - - "sratools: 2.11.0" diff --git a/tests/modules/custom/ncbisettings/main.nf b/tests/modules/custom/sratoolsncbisettings/main.nf similarity index 75% rename from tests/modules/custom/ncbisettings/main.nf rename to tests/modules/custom/sratoolsncbisettings/main.nf index f4d1fcfd..be316a39 100644 --- a/tests/modules/custom/ncbisettings/main.nf +++ b/tests/modules/custom/sratoolsncbisettings/main.nf @@ -2,18 +2,18 @@ nextflow.enable.dsl = 2 -include { SRATOOLS_NCBISETTINGS } from '../../../../modules/sratools/ncbisettings/main.nf' +include { CUSTOM_SRATOOLSNCBISETTINGS } from '../../../../modules/custom/sratoolsncbisettings/main.nf' -workflow test_sratools_ncbisettings_with_good_existing { +workflow test_sratoolsncbisettings_with_good_existing { file(params.settings_path).mkdirs() def settings = file(params.test_data['generic']['config']['ncbi_user_settings'], checkIfExists: true) settings.copyTo(params.settings_file) - SRATOOLS_NCBISETTINGS() + CUSTOM_SRATOOLSNCBISETTINGS() } -workflow test_sratools_ncbisettings_with_bad_existing { +workflow test_sratoolsncbisettings_with_bad_existing { file(params.settings_path).mkdirs() def settings = file(params.settings_file) @@ -33,9 +33,9 @@ workflow test_sratools_ncbisettings_with_bad_existing { /repository/user/default-path = "/root/ncbi" '''.stripIndent() - SRATOOLS_NCBISETTINGS() + CUSTOM_SRATOOLSNCBISETTINGS() } -workflow test_sratools_ncbisettings_with_nonexisting { - SRATOOLS_NCBISETTINGS() +workflow test_sratoolsncbisettings_with_nonexisting { + CUSTOM_SRATOOLSNCBISETTINGS() } diff --git a/tests/modules/custom/ncbisettings/nextflow.config b/tests/modules/custom/sratoolsncbisettings/nextflow.config similarity index 100% rename from tests/modules/custom/ncbisettings/nextflow.config rename to tests/modules/custom/sratoolsncbisettings/nextflow.config diff --git a/tests/modules/custom/ncbisettings/nextflow_mount.config b/tests/modules/custom/sratoolsncbisettings/nextflow_mount.config similarity index 91% rename from tests/modules/custom/ncbisettings/nextflow_mount.config rename to tests/modules/custom/sratoolsncbisettings/nextflow_mount.config index 823082c0..853844c5 100644 --- a/tests/modules/custom/ncbisettings/nextflow_mount.config +++ b/tests/modules/custom/sratoolsncbisettings/nextflow_mount.config @@ -7,7 +7,7 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: SRATOOLS_NCBISETTINGS { + withName: CUSTOM_SRATOOLSNCBISETTINGS { containerOptions = { (workflow.containerEngine == 'singularity') ? "-B ${params.settings_path}:${params.settings_path}" : diff --git a/tests/modules/custom/sratoolsncbisettings/test.yml b/tests/modules/custom/sratoolsncbisettings/test.yml new file mode 100644 index 00000000..df3cd936 --- /dev/null +++ b/tests/modules/custom/sratoolsncbisettings/test.yml @@ -0,0 +1,44 @@ +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_good_existing" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_good_existing -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow_mount.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + files: + - path: "output/custom/user-settings.mkfg" + md5sum: 955e27aff2c277c2f1f0943a098888c1 + - path: output/custom/versions.yml + contains: + - "sratools: 2.11.0" + +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_bad_existing" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_bad_existing -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow_mount.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + exit_code: 1 + stdout: + contains: + - "Command error:" + - "missing the required entries" + - "/LIBS/GUID" + - "/libs/cloud/report_instance_identity" + - "Feel free to add the following" + files: + - path: "output/custom/user-settings.mkfg" + should_exist: false + - path: output/custom/versions.yml + should_exist: false + +- name: "custom sratoolsncbisettings test_sratoolsncbisettings_with_nonexisting" + command: nextflow run ./tests/modules/custom/sratoolsncbisettings -entry test_sratoolsncbisettings_with_nonexisting -c ./tests/config/nextflow.config -c ./tests/modules/custom/sratoolsncbisettings/nextflow.config + tags: + - "custom" + - "custom/sratoolsncbisettings" + files: + - path: "output/custom/user-settings.mkfg" + contains: + - "/LIBS/GUID" + - "/libs/cloud/report_instance_identity" + - path: output/custom/versions.yml + contains: + - "sratools: 2.11.0"