From 8e97db105bc5748686e48e70f269a051243c973d Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 11:42:30 +0200 Subject: [PATCH 01/11] init nf test and add initial test for pipeline --- .gitignore | 3 +++ nf-test.config | 20 ++++++++++++++++++++ tests/nextflow.config | 19 +++++++++++++++++++ tests/pipeline/test.nf.test | 22 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 nf-test.config create mode 100644 tests/nextflow.config create mode 100644 tests/pipeline/test.nf.test diff --git a/.gitignore b/.gitignore index 5124c9ac..16220a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ results/ testing/ testing* *.pyc +.nf-test/ +results_test/* +.nf-test* diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 00000000..69f28960 --- /dev/null +++ b/nf-test.config @@ -0,0 +1,20 @@ +config { + +config { + // location for all nf-tests + testsDir "tests" + + // nf-test directory including temporary files for each test + workDir ".nf-test" + + // location of library folder that is added automatically to the classpath + libDir "tests/pipeline/lib/" + + // location of an optional nextflow.config file specific for executing tests + configFile "tests/nextflow.config" + + // run all test with the defined docker profile from the main nextflow.config + profile "" +} + +} diff --git a/tests/nextflow.config b/tests/nextflow.config new file mode 100644 index 00000000..1a15db30 --- /dev/null +++ b/tests/nextflow.config @@ -0,0 +1,19 @@ +// Impose sensible resource limits for testing +process { + withName: '.*' { + cpus = 2 + memory = 3.GB + time = 2.h + } +} + +// Impose same minimum Nextflow version as the pipeline for testing +manifest { + nextflowVersion = '!>=23.04.0' +} + +// Disable all Nextflow reporting options +timeline { enabled = false } +report { enabled = false } +trace { enabled = false } +dag { enabled = false } diff --git a/tests/pipeline/test.nf.test b/tests/pipeline/test.nf.test new file mode 100644 index 00000000..f2bf41e8 --- /dev/null +++ b/tests/pipeline/test.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test" + tag "pipeline" + + test("test assembly and bin input") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} From 77452299dc14f39ee30ee2e1b932248d9d7edeb4 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 11:42:51 +0200 Subject: [PATCH 02/11] Change CI to include nf-test (no ncbi credentials) --- .github/workflows/ci.yml | 134 ++++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 733fd2db..6145cf42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,36 +1,82 @@ -name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors +name: nf-core CI on: push: branches: - - dev + - "dev" pull_request: + branches: + - "dev" + - "master" release: - types: [published] + types: + - "published" env: NXF_ANSI_LOG: false + NFTEST_VER: "0.7.3" concurrency: - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: + define_nxf_versions: + name: Choose nextflow versions to test against depending on target branch + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.nxf_versions.outputs.matrix }} + steps: + - id: nxf_versions + run: | + if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then + echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT + else + echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT + fi + test: - name: Run pipeline with assembly test data - # Only run on push if this is the nf-core dev branch (merged PRs) - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/metapep') }}" + name: nf-test + needs: define_nxf_versions runs-on: ubuntu-latest strategy: fail-fast: false matrix: - NXF_VER: - - "23.04.0" - - "latest-everything" + NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }} + tags: + - "test" + - "test_model_information" + - "test_mouse_all_pep_lengths" + - "test_assembly_only" + - "test_bins_only" + - "test_coassembly" + - "test_mhcflurry" + - "test_mhcnuggets_1" + - "test_mhcnuggets_2" + profile: + - "docker" + steps: - name: Check out pipeline code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Check out test data + uses: actions/checkout@v3 + with: + repository: nf-core/test-datasets + ref: metapep + path: test-datasets/ + fetch-depth: 1 + + - name: Replace remote paths in samplesheets + run: | + for f in ${{ github.workspace }}/test-datasets/samplesheets/*.tsv; do + sed -i "s=https://github.com/nf-core/test-datasets/raw/metapep/testdata/=${{ github.workspace }}/test-datasets/=g" $f + echo "========== $f ============" + cat $f + echo "========================================" + done; + - name: Install Nextflow uses: nf-core/setup-nextflow@v1 with: @@ -39,63 +85,23 @@ jobs: - name: Disk space cleanup uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - - name: Run pipeline with test data - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results - - profile: - name: Run additional profile tests - # Only run on push if this is the nf-core dev branch (merged PRs) - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/metapep') }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - tests: [ - "test_model_information", - "test_mouse_all_pep_lengths", - "test_assembly_only", - "test_bins_only", - "test_coassembly", - "test_mhcflurry", - "test_mhcnuggets_1", - "test_mhcnuggets_2", - ] # add further test profiles here, will be run in parallel (but only with one nextflow version) - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 - - - name: Install Nextflow + - name: Install nf-test run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER + sudo mv nf-test /usr/local/bin/ - - name: Run pipeline with profile ${{ matrix.tests }} + - name: Run nf-test run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.tests }},docker --outdir ./results - - all_profiles: - name: Run all additional profile tests that require ncbi credentials - # Only run on PRs from branches of nf-core/metapep repository or on push if this is the nf-core dev branch (merged PRs) - # (GitHub secrets are not accessible for workflows from forks) - if: ${{ github.event.pull_request.head.repo.full_name == 'nf-core/metapep' || (github.event_name == 'push' && github.repository == 'nf-core/metapep') }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - tests: ["test_all", "test_mouse", "test_taxa_only", "test_taxa_specific_assembly"] # add further test profiles here, will be run in parallel (but only with one nextflow version) - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 + nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml - - name: Install Nextflow + - name: Output log on failure + if: failure() run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + sudo apt install bat > /dev/null + batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/output/pipeline_info/software_versions.yml - - name: Run pipeline with profile ${{ matrix.tests }} - env: - NCBI_EMAIL: ${{ secrets.NCBI_EMAIL }} - NCBI_KEY: ${{ secrets.NCBI_KEY }} - run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.tests }},docker --ncbi_email "$NCBI_EMAIL" --ncbi_key "$NCBI_KEY" --outdir ./results + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: "*.xml" From 7cdbefd3ed41f70d6cc7dda4327db016bff12002 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 11:50:52 +0200 Subject: [PATCH 03/11] fix ci paths to samplesheets --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6145cf42..8bedb646 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,8 +70,8 @@ jobs: - name: Replace remote paths in samplesheets run: | - for f in ${{ github.workspace }}/test-datasets/samplesheets/*.tsv; do - sed -i "s=https://github.com/nf-core/test-datasets/raw/metapep/testdata/=${{ github.workspace }}/test-datasets/=g" $f + for f in ${{ github.workspace }}/test-datasets/samplesheets/v1.0/*.csv; do + sed -i "s=https://github.com/nf-core/test-datasets/tree/metapep/testdata/=${{ github.workspace }}/test-datasets/=g" $f echo "========== $f ============" cat $f echo "========================================" From 83e85e5dd7f9e4c9f8b6f85218446fb58d84d0ee Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 12:55:29 +0200 Subject: [PATCH 04/11] remove nf-test nextflow.config for now --- tests/nextflow.config | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/nextflow.config b/tests/nextflow.config index 1a15db30..3d45039a 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,19 +1 @@ -// Impose sensible resource limits for testing -process { - withName: '.*' { - cpus = 2 - memory = 3.GB - time = 2.h - } -} - // Impose same minimum Nextflow version as the pipeline for testing -manifest { - nextflowVersion = '!>=23.04.0' -} - -// Disable all Nextflow reporting options -timeline { enabled = false } -report { enabled = false } -trace { enabled = false } -dag { enabled = false } From 5190cdb218f2202124d2fe8123c3f02a365783d6 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 13:06:41 +0200 Subject: [PATCH 05/11] Create placeholder tests for all test profiles (still no ncbi login) --- tests/pipeline/test_assembly_only.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_bins_only.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_coassembly.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_mhcflurry.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_mhcnuggets_1.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_mhcnuggets_2.nf.test | 22 +++++++++++++++++++ tests/pipeline/test_model_information.nf.test | 22 +++++++++++++++++++ .../test_mouse_all_pep_lengths.nf.test | 22 +++++++++++++++++++ 8 files changed, 176 insertions(+) create mode 100644 tests/pipeline/test_assembly_only.nf.test create mode 100644 tests/pipeline/test_bins_only.nf.test create mode 100644 tests/pipeline/test_coassembly.nf.test create mode 100644 tests/pipeline/test_mhcflurry.nf.test create mode 100644 tests/pipeline/test_mhcnuggets_1.nf.test create mode 100644 tests/pipeline/test_mhcnuggets_2.nf.test create mode 100644 tests/pipeline/test_model_information.nf.test create mode 100644 tests/pipeline/test_mouse_all_pep_lengths.nf.test diff --git a/tests/pipeline/test_assembly_only.nf.test b/tests/pipeline/test_assembly_only.nf.test new file mode 100644 index 00000000..fba50a6e --- /dev/null +++ b/tests/pipeline/test_assembly_only.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_assembly_only" + tag "pipeline" + + test("test assembly input") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_bins_only.nf.test b/tests/pipeline/test_bins_only.nf.test new file mode 100644 index 00000000..e9dea00c --- /dev/null +++ b/tests/pipeline/test_bins_only.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_bins_only" + tag "pipeline" + + test("test bin input") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_coassembly.nf.test b/tests/pipeline/test_coassembly.nf.test new file mode 100644 index 00000000..fa410743 --- /dev/null +++ b/tests/pipeline/test_coassembly.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test" + tag "pipeline" + + test("test coassembly input") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_mhcflurry.nf.test b/tests/pipeline/test_mhcflurry.nf.test new file mode 100644 index 00000000..0385ded0 --- /dev/null +++ b/tests/pipeline/test_mhcflurry.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_mhcflurry" + tag "pipeline" + + test("test mhcflurry prediction") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_mhcnuggets_1.nf.test b/tests/pipeline/test_mhcnuggets_1.nf.test new file mode 100644 index 00000000..c18f67e4 --- /dev/null +++ b/tests/pipeline/test_mhcnuggets_1.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_mhcnuggets_1" + tag "pipeline" + + test("test mhcnuggets hla type 1 prediction") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_mhcnuggets_2.nf.test b/tests/pipeline/test_mhcnuggets_2.nf.test new file mode 100644 index 00000000..2b6186dd --- /dev/null +++ b/tests/pipeline/test_mhcnuggets_2.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_mhcnuggets_2" + tag "pipeline" + + test("test mhcnuggets hla type 2 prediction") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_model_information.nf.test b/tests/pipeline/test_model_information.nf.test new file mode 100644 index 00000000..d8e7961e --- /dev/null +++ b/tests/pipeline/test_model_information.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_model_information" + tag "pipeline" + + test("test model information subbranch") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_mouse_all_pep_lengths.nf.test b/tests/pipeline/test_mouse_all_pep_lengths.nf.test new file mode 100644 index 00000000..5e377c41 --- /dev/null +++ b/tests/pipeline/test_mouse_all_pep_lengths.nf.test @@ -0,0 +1,22 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_mouse_all_pep_lengths" + tag "pipeline" + + test("test mouse assembly allowing all peptide lengths") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + } + + } + +} From 56ba42f0a1bfb240e553ef433cb2c52371ab78aa Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 13:12:27 +0200 Subject: [PATCH 06/11] fix coassembly placeholder --- tests/pipeline/test_coassembly.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pipeline/test_coassembly.nf.test b/tests/pipeline/test_coassembly.nf.test index fa410743..a97f7ea8 100644 --- a/tests/pipeline/test_coassembly.nf.test +++ b/tests/pipeline/test_coassembly.nf.test @@ -2,7 +2,7 @@ nextflow_pipeline { name "Test Workflow main.nf" script "main.nf" - tag "test" + tag "test_coassembly" tag "pipeline" test("test coassembly input") { From 11d5b6e4334fd530a525c6b3e0464d4c618883b9 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Fri, 19 Apr 2024 14:15:04 +0200 Subject: [PATCH 07/11] add linting exceptions --- .nf-core.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.nf-core.yml b/.nf-core.yml index 3805dc81..6078dcf6 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1 +1,5 @@ repository_type: pipeline +lint: + files_exist: + - conf/igenomes.config + actions_ci: False From 0d30528753c93e7cede0a56438b4f312573c97e6 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Mon, 22 Apr 2024 07:04:55 +0200 Subject: [PATCH 08/11] Add additional test profiles --- .github/workflows/ci.yml | 73 ++++++++++++++++++- tests/pipeline/test_all.nf.test | 24 ++++++ tests/pipeline/test_mouse.nf.test | 24 ++++++ tests/pipeline/test_taxa_only.nf.test | 24 ++++++ .../test_taxa_specific_assembly.nf.test | 24 ++++++ 5 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 tests/pipeline/test_all.nf.test create mode 100644 tests/pipeline/test_mouse.nf.test create mode 100644 tests/pipeline/test_taxa_only.nf.test create mode 100644 tests/pipeline/test_taxa_specific_assembly.nf.test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bedb646..77e3398d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,8 @@ jobs: echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT fi - test: - name: nf-test + test_profile_standard: + name: nf-test with standard profiles needs: define_nxf_versions runs-on: ubuntu-latest strategy: @@ -105,3 +105,72 @@ jobs: if: always() # always run even if the previous step fails with: report_paths: "*.xml" + + profile_download: + name: nf-test with profiles needing entrez downloads + needs: define_nxf_versions + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }} + tags: + - "test_all" + - "test_mouse" + - "test_taxa_only" + - "test_taxa_specific_assembly" + profile: + - "docker" + + steps: + - name: Check out pipeline code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + + - name: Check out test data + uses: actions/checkout@v3 + with: + repository: nf-core/test-datasets + ref: metapep + path: test-datasets/ + fetch-depth: 1 + + - name: Replace remote paths in samplesheets + run: | + for f in ${{ github.workspace }}/test-datasets/samplesheets/v1.0/*.csv; do + sed -i "s=https://github.com/nf-core/test-datasets/tree/metapep/testdata/=${{ github.workspace }}/test-datasets/=g" $f + echo "========== $f ============" + cat $f + echo "========================================" + done; + + - name: Install Nextflow + uses: nf-core/setup-nextflow@v1 + with: + version: "${{ matrix.NXF_VER }}" + + - name: Disk space cleanup + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + + - name: Install nf-test + run: | + wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER + sudo mv nf-test /usr/local/bin/ + + - name: Run nf-test + env: + NCBI_EMAIL: ${{ secrets.NCBI_EMAIL }} + NCBI_KEY: ${{ secrets.NCBI_KEY }} + run: | + nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml + + - name: Output log on failure + if: failure() + run: | + sudo apt install bat > /dev/null + batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/output/pipeline_info/software_versions.yml + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: "*.xml" diff --git a/tests/pipeline/test_all.nf.test b/tests/pipeline/test_all.nf.test new file mode 100644 index 00000000..45c68854 --- /dev/null +++ b/tests/pipeline/test_all.nf.test @@ -0,0 +1,24 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_all" + tag "pipeline" + + test("test all input path including protein downloads") { + + when { + params { + outdir = "$outputDir" + ncbi_email = "$NCBI_EMAIL" + ncbi_key = "$NCBI_KEY" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_mouse.nf.test b/tests/pipeline/test_mouse.nf.test new file mode 100644 index 00000000..69c9399e --- /dev/null +++ b/tests/pipeline/test_mouse.nf.test @@ -0,0 +1,24 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_mouse" + tag "pipeline" + + test("test mouse alleles within download path (allele prediction reduction)") { + + when { + params { + outdir = "$outputDir" + ncbi_email = "$NCBI_EMAIL" + ncbi_key = "$NCBI_KEY" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_taxa_only.nf.test b/tests/pipeline/test_taxa_only.nf.test new file mode 100644 index 00000000..30fa5926 --- /dev/null +++ b/tests/pipeline/test_taxa_only.nf.test @@ -0,0 +1,24 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_taxa_only" + tag "pipeline" + + test("test taxa input") { + + when { + params { + outdir = "$outputDir" + ncbi_email = "$NCBI_EMAIL" + ncbi_key = "$NCBI_KEY" + } + } + + then { + assert workflow.success + } + + } + +} diff --git a/tests/pipeline/test_taxa_specific_assembly.nf.test b/tests/pipeline/test_taxa_specific_assembly.nf.test new file mode 100644 index 00000000..c8f1c508 --- /dev/null +++ b/tests/pipeline/test_taxa_specific_assembly.nf.test @@ -0,0 +1,24 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_taxa_specific_assembly" + tag "pipeline" + + test("test taxa input with assembly id") { + + when { + params { + outdir = "$outputDir" + ncbi_email = "$NCBI_EMAIL" + ncbi_key = "$NCBI_KEY" + } + } + + then { + assert workflow.success + } + + } + +} From 383e49a7f15e1e5c7e69596ddfb5424c997c9c27 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Wed, 24 Apr 2024 14:16:20 +0200 Subject: [PATCH 09/11] Try getting github secrets in nf-test --- nf-test.config | 4 +--- tests/nextflow.config | 5 ++++- tests/pipeline/test_all.nf.test | 4 ++-- tests/pipeline/test_mouse.nf.test | 4 ++-- tests/pipeline/test_taxa_only.nf.test | 4 ++-- tests/pipeline/test_taxa_specific_assembly.nf.test | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/nf-test.config b/nf-test.config index 69f28960..a1359d77 100644 --- a/nf-test.config +++ b/nf-test.config @@ -1,5 +1,3 @@ -config { - config { // location for all nf-tests testsDir "tests" @@ -15,6 +13,6 @@ config { // run all test with the defined docker profile from the main nextflow.config profile "" -} } + diff --git a/tests/nextflow.config b/tests/nextflow.config index 3d45039a..4dd1ad12 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1 +1,4 @@ -// Impose same minimum Nextflow version as the pipeline for testing +//env { +// NCBI_EMAIL = '\$"\u007B""\u007B" NCBI_EMAIL "\u007D""\u007D"' +// NCBI_KEY = '\$"\u007B""\u007B" NCBI_KEY "\u007D""\u007D"' +// } diff --git a/tests/pipeline/test_all.nf.test b/tests/pipeline/test_all.nf.test index 45c68854..77126cd5 100644 --- a/tests/pipeline/test_all.nf.test +++ b/tests/pipeline/test_all.nf.test @@ -10,8 +10,8 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - ncbi_email = "$NCBI_EMAIL" - ncbi_key = "$NCBI_KEY" + ncbi_email = "\$NCBI_EMAIL" + ncbi_key = "\$NCBI_KEY" } } diff --git a/tests/pipeline/test_mouse.nf.test b/tests/pipeline/test_mouse.nf.test index 69c9399e..071201ac 100644 --- a/tests/pipeline/test_mouse.nf.test +++ b/tests/pipeline/test_mouse.nf.test @@ -10,8 +10,8 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - ncbi_email = "$NCBI_EMAIL" - ncbi_key = "$NCBI_KEY" + ncbi_email = "\$NCBI_EMAIL" + ncbi_key = "\$NCBI_KEY" } } diff --git a/tests/pipeline/test_taxa_only.nf.test b/tests/pipeline/test_taxa_only.nf.test index 30fa5926..d14f3c16 100644 --- a/tests/pipeline/test_taxa_only.nf.test +++ b/tests/pipeline/test_taxa_only.nf.test @@ -10,8 +10,8 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - ncbi_email = "$NCBI_EMAIL" - ncbi_key = "$NCBI_KEY" + ncbi_email = "\$NCBI_EMAIL" + ncbi_key = "\$NCBI_KEY" } } diff --git a/tests/pipeline/test_taxa_specific_assembly.nf.test b/tests/pipeline/test_taxa_specific_assembly.nf.test index c8f1c508..c6de1357 100644 --- a/tests/pipeline/test_taxa_specific_assembly.nf.test +++ b/tests/pipeline/test_taxa_specific_assembly.nf.test @@ -10,8 +10,8 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - ncbi_email = "$NCBI_EMAIL" - ncbi_key = "$NCBI_KEY" + ncbi_email = "\\\$NCBI_EMAIL" + ncbi_key = "\\\$NCBI_KEY" } } From b56e530f1354327bfe291bffd9b15bc4a7006014 Mon Sep 17 00:00:00 2001 From: Till Englert Date: Wed, 24 Apr 2024 14:18:26 +0200 Subject: [PATCH 10/11] .. --- tests/nextflow.config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/nextflow.config b/tests/nextflow.config index 4dd1ad12..54484af3 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,4 +1,4 @@ -//env { -// NCBI_EMAIL = '\$"\u007B""\u007B" NCBI_EMAIL "\u007D""\u007D"' -// NCBI_KEY = '\$"\u007B""\u007B" NCBI_KEY "\u007D""\u007D"' -// } +env { + NCBI_EMAIL = "$NCBI_EMAIL" + NCBI_KEY = "$NCBI_KEY" + } From 618a28b15342169e825a34c918f10b1d5f7418fe Mon Sep 17 00:00:00 2001 From: Till Englert Date: Wed, 24 Apr 2024 14:30:02 +0200 Subject: [PATCH 11/11] .. --- tests/pipeline/test_taxa_specific_assembly.nf.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipeline/test_taxa_specific_assembly.nf.test b/tests/pipeline/test_taxa_specific_assembly.nf.test index c6de1357..dd39e463 100644 --- a/tests/pipeline/test_taxa_specific_assembly.nf.test +++ b/tests/pipeline/test_taxa_specific_assembly.nf.test @@ -10,8 +10,8 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - ncbi_email = "\\\$NCBI_EMAIL" - ncbi_key = "\\\$NCBI_KEY" + ncbi_email = "\$NCBI_EMAIL" + ncbi_key = "\$NCBI_KEY" } }