Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nf test local subworkflows #224

Merged
merged 27 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b0236dd
move subwf tests to the subwf folder
nvnieuwk Nov 14, 2024
ddb39a2
add restrictions on sample and family name
nvnieuwk Nov 14, 2024
2830175
Merge branch 'nf-test-local-modules' into nf-test-local-subworkflows
nvnieuwk Nov 14, 2024
9d4db4f
test vcf_concat_bcftools
nvnieuwk Nov 14, 2024
5d1f117
test vcf_filter_bcftools
nvnieuwk Nov 14, 2024
37f15b5
add a test coverage ci comment
nvnieuwk Nov 14, 2024
d24dc42
pre-commit
nvnieuwk Nov 14, 2024
883a606
print out the coverage in the ci logs
nvnieuwk Nov 14, 2024
53a3f76
fix missing $ in coverage action
nvnieuwk Nov 14, 2024
de81099
update shell
nvnieuwk Nov 14, 2024
df481a3
try another method
nvnieuwk Nov 14, 2024
81ae13b
use env instead
nvnieuwk Nov 14, 2024
8a62fad
use another env method
nvnieuwk Nov 14, 2024
816d411
use another env method
nvnieuwk Nov 14, 2024
1feca5f
try even more methods
nvnieuwk Nov 14, 2024
c8c0fa3
convert points to -
nvnieuwk Nov 14, 2024
4b495e3
fix wrongly place quote
nvnieuwk Nov 14, 2024
94af572
retrigger ci tests
nvnieuwk Nov 14, 2024
fd97047
forget coverage
nvnieuwk Nov 14, 2024
6611a85
add triggers for full test runs
nvnieuwk Nov 14, 2024
344f240
run all tests on PRs to main
nvnieuwk Nov 14, 2024
382e015
fix if statement
nvnieuwk Nov 14, 2024
8c50b03
fix test vcf_ped_rtgtools + fix ci
nvnieuwk Nov 14, 2024
62a054b
fix cram prepare subwf tests
nvnieuwk Nov 14, 2024
300ee2b
fix more workflow tests
nvnieuwk Nov 14, 2024
b8fbdce
set test dir to root of repo
nvnieuwk Nov 14, 2024
93e956f
don't do disk space cleanup anymore
nvnieuwk Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
env:
NXF_ANSI_LOG: false
NFT_MAX_SHARDS: 5
SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
Expand Down Expand Up @@ -51,14 +52,15 @@ jobs:
with:
version: "${{ matrix.NXF_VER }}"

- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
# - name: Disk space cleanup
# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Install nf-test
run: |
conda install -c bioconda nf-test

- name: "Run ${{ matrix.filter }} tests | ${{ matrix.shard }}/${{ env.NFT_MAX_SHARDS }}"
- name: "Run ${{ matrix.filter }} tests (changed) | ${{ matrix.shard }}/${{ env.NFT_MAX_SHARDS }}"
if: ${{ env.SOURCE_BRANCH != 'main' }}
run: |
$CONDA/bin/nf-test test \
--ci \
Expand All @@ -67,6 +69,15 @@ jobs:
--filter ${{ matrix.filter }} \
--junitxml=default.xml

- name: "Run ${{ matrix.filter }} tests (all) | ${{ matrix.shard }}/${{ env.NFT_MAX_SHARDS }}"
if: ${{ env.SOURCE_BRANCH == 'main' }}
run: |
$CONDA/bin/nf-test test \
--ci \
--shard ${{ matrix.shard }}/${{ env.NFT_MAX_SHARDS }} \
--filter ${{ matrix.filter }} \
--junitxml=default.xml

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
Expand Down
8 changes: 6 additions & 2 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
"properties": {
"sample": {
"type": "string",
"meta": ["id", "sample"]
"pattern": "^[^\\. ]+$",
"meta": ["id", "sample"],
"errorMessage": "Sample name should be a string that does not contain dots or spaces"
},
"family": {
"type": "string",
"meta": ["family"]
"pattern": "^[^\\. ]+$",
"meta": ["family"],
"errorMessage": "Family name should be a string that does not contain dots or spaces"
},
"cram": {
"oneOf": [
Expand Down
1 change: 0 additions & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ params {
vcfanno = true
vcfanno_config = "${projectDir}/assets/vcfanno.toml"
vcfanno_resources = "https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz;https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz.tbi"

}

process {
Expand Down
4 changes: 3 additions & 1 deletion nf-test.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config {

testsDir "tests"
testsDir "."
workDir ".nf-test"
configFile "tests/nextflow.config"
profile "nf_test,docker"
Expand All @@ -10,4 +10,6 @@ config {
load "[email protected]"
}

triggers "conf/modules.config", "nextflow.config"

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow BAM_CALL_ELPREP"
script "subworkflows/local/bam_call_elprep/main.nf"
script "../main.nf"
workflow "BAM_CALL_ELPREP"

tag "subworkflows"
Expand Down
1 change: 0 additions & 1 deletion subworkflows/local/bam_call_vardictjava/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ workflow BAM_CALL_VARDICTJAVA {
ch_fai // channel: [mandatory] [ val(meta), path(fai) ] => fasta reference index
ch_dbsnp // channel: [optional] [ path(vcf) ] => the dbnsp vcf file
ch_dbsnp_tbi // channel: [optional] [ path(tbi) ] => the dbsnp vcf index file
filter // boolean: filter the VCFs

main:
def ch_versions = Channel.empty()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow BAM_CALL_VARDICTJAVA"
script "subworkflows/local/bam_call_vardictjava/main.nf"
script "../main.nf"
workflow "BAM_CALL_VARDICTJAVA"

tag "subworkflows"
Expand Down Expand Up @@ -43,7 +43,6 @@ nextflow_workflow {
])
input[3] = [[],[]]
input[4] = [[],[]]
input[5] = false
"""
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow CRAM_CALL_GATK4"
script "subworkflows/local/cram_call_gatk4/main.nf"
script "../main.nf"
workflow "CRAM_CALL_GATK4"

tag "subworkflows"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow CRAM_PREPARE_SAMTOOLS_BEDTOOLS"
script "subworkflows/local/cram_prepare_samtools_bedtools/main.nf"
script "../main.nf"
workflow "CRAM_PREPARE_SAMTOOLS_BEDTOOLS"

tag "subworkflows"
Expand Down Expand Up @@ -49,7 +49,7 @@ nextflow_workflow {
},
workflow.out.ready_beds,
workflow.out.reports
).match("default - WGS") }
).match() }
)
}

Expand Down Expand Up @@ -96,7 +96,7 @@ nextflow_workflow {
},
workflow.out.ready_beds,
workflow.out.reports
).match("default - WES common ROI") }
).match() }
)
}

Expand Down Expand Up @@ -143,7 +143,7 @@ nextflow_workflow {
},
workflow.out.ready_beds,
workflow.out.reports
).match("default - WES") }
).match() }
)
}

Expand Down Expand Up @@ -197,7 +197,7 @@ nextflow_workflow {
},
workflow.out.ready_beds,
workflow.out.reports
).match("default - merge") }
).match() }
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default - merge": {
"cram_prepare_samtools_bedtools - default - WES common ROI": {
"content": [
[
[
Expand All @@ -8,9 +8,9 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 2
"duplicate_count": 1
},
"NA24143.cram,readsMD5:be28f434d6f7bcfa398488a6611d89c1",
"/nf-cmgg/test-datasets/raw/germline/data/genomics/homo_sapiens/illumina/crams/NA24143.cram",
"NA24143.cram.crai"
]
],
Expand All @@ -21,9 +21,9 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 2
"duplicate_count": 1
},
"NA24143.bam,readsMD5:be28f434d6f7bcfa398488a6611d89c1",
"NA24143.bam,readsMD5:77afffb023e537869c5c6ebf31187ded",
"NA24143.bam.bai"
]
],
Expand All @@ -34,22 +34,22 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 2
"duplicate_count": 1
},
"NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046"
"NA24143.intersect.bed:md5,b87069698afefb15282d069e56110046"
]
],
[

]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-23T10:19:20.53195135"
"timestamp": "2024-11-14T16:07:03.620603158"
},
"default - WGS": {
"cram_prepare_samtools_bedtools - default - WES": {
"content": [
[
[
Expand All @@ -76,20 +76,20 @@
"family_samples": "NA24143",
"duplicate_count": 1
},
"NA24143.filter.bed:md5,85a5568a6976ed455caa712991b30ac2"
"NA24143.intersect.bed:md5,b87069698afefb15282d069e56110046"
]
],
[

]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-23T10:17:48.433466279"
"timestamp": "2024-11-14T16:07:24.688580575"
},
"default - WES": {
"cram_prepare_samtools_bedtools - default - WGS": {
"content": [
[
[
Expand All @@ -116,20 +116,20 @@
"family_samples": "NA24143",
"duplicate_count": 1
},
"NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046"
"NA24143.filter.bed:md5,85a5568a6976ed455caa712991b30ac2"
]
],
[

]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-23T10:18:36.993186258"
"timestamp": "2024-11-14T16:06:42.311563291"
},
"default - WES common ROI": {
"cram_prepare_samtools_bedtools - default - merge": {
"content": [
[
[
Expand All @@ -138,9 +138,9 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 1
"duplicate_count": 2
},
"/nf-cmgg/test-datasets/raw/germline/data/genomics/homo_sapiens/illumina/crams/NA24143.cram",
"NA24143.cram,readsMD5:be28f434d6f7bcfa398488a6611d89c1",
"NA24143.cram.crai"
]
],
Expand All @@ -151,9 +151,9 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 1
"duplicate_count": 2
},
"NA24143.bam,readsMD5:77afffb023e537869c5c6ebf31187ded",
"NA24143.bam,readsMD5:be28f434d6f7bcfa398488a6611d89c1",
"NA24143.bam.bai"
]
],
Expand All @@ -164,19 +164,19 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_samples": "NA24143",
"duplicate_count": 1
"duplicate_count": 2
},
"NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046"
"NA24143.intersect.bed:md5,b87069698afefb15282d069e56110046"
]
],
[

]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-23T10:18:13.865281894"
"timestamp": "2024-11-14T16:08:20.712943795"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow GVCF_JOINT_GENOTYPE_GATK4"
script "subworkflows/local/gvcf_joint_genotype_gatk4/main.nf"
script "../main.nf"
workflow "GVCF_JOINT_GENOTYPE_GATK4"

tag "subworkflows"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow INPUT_SPLIT_BEDTOOLS"
script "subworkflows/local/input_split_bedtools/main.nf"
script "../main.nf"
workflow "INPUT_SPLIT_BEDTOOLS"

tag "subworkflows"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nextflow_workflow {

name "Test Workflow VCF_ANNOTATION"
script "subworkflows/local/vcf_annotation/main.nf"
script "../main.nf"
workflow "VCF_ANNOTATION"

tag "subworkflows"
Expand Down Expand Up @@ -44,9 +44,9 @@ nextflow_workflow {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.annotated_vcfs.collect { it.collect { it instanceof Map ? it.groupTarget : file(it).name } },
workflow.out.annotated_vcfs.collect { [ it[0].groupTarget, it[1][-7..-1] ]},
workflow.out.reports
).match("default") }
).match() }
)
}

Expand Down Expand Up @@ -87,9 +87,9 @@ nextflow_workflow {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.annotated_vcfs.collect { it.collect { it instanceof Map ? it.groupTarget : file(it).name } },
workflow.out.annotated_vcfs.collect { [ it[0].groupTarget, it[1][-7..-1] ] },
workflow.out.reports
).match("vcfanno") }
).match() }
)
}

Expand Down
Loading
Loading