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

Add ci nftests #381

Merged
merged 20 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
NXF_ANSI_LOG: false
CAPSULE_LOG: none
NFTEST_VER: "0.8.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not using sharding or latest nf-test due to the issue with download limit from mirBase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshots seem to have been done with 0.9.0
maybe it is worth updating to 0.9.0 but keeping out the sharding?


concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
Expand Down Expand Up @@ -46,6 +48,22 @@ jobs:
- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data
- name: Install nf-test
run: |
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profile }},docker --outdir ./results
wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER
sudo mv nf-test /usr/local/bin/

- name: Run nf-test
run: nf-test test tests/${{ matrix.profile }}.nf.test --profile +docker --junitxml=test.xml

- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always .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: test.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ testing/
testing*
*.pyc
execution_trace*
.nf-test*
11 changes: 11 additions & 0 deletions tests/lib/UTILS.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Function to remove Nextflow version from software_versions.yml

class UTILS {
public static String removeNextflowVersion(outputDir) {
def softwareVersions = path("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").yaml
if (softwareVersions.containsKey("Workflow")) {
softwareVersions.Workflow.remove("Nextflow")
}
return softwareVersions
}
}
27 changes: 27 additions & 0 deletions tests/test.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test"
script "main.nf"
profile "test"
tag "test"
tag "pipeline"

test("test") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 196 }
)
}

}

}
27 changes: 27 additions & 0 deletions tests/test_index.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test_index"
script "main.nf"
profile "test_index"
tag "test_index"
tag "pipeline"

test("test_index") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 161 }
)
}

}

}
27 changes: 27 additions & 0 deletions tests/test_mirgenedb.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test_mirgenedb"
script "main.nf"
profile "test_mirgenedb"
tag "test_mirgenedb"
tag "pipeline"

test("test_mirgenedb") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 193 }
)
}

}

}
27 changes: 27 additions & 0 deletions tests/test_no_genome.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test_no_genome"
script "main.nf"
profile "test_no_genome"
tag "test_no_genome"
tag "pipeline"

test("test_no_genome") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 147 }
)
}

}

}
27 changes: 27 additions & 0 deletions tests/test_technical_repeats.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test_technical_repeats"
script "main.nf"
profile "test_technical_repeats"
tag "test_technical_repeats"
tag "pipeline"

test("test_technical_repeats") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 75 }
)
}

}

}
27 changes: 27 additions & 0 deletions tests/test_umi.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nextflow_pipeline {

name "Test Workflow main.nf - test_umi"
script "main.nf"
profile "test_umi"
tag "test_umi"
tag "pipeline"

test("test_umi") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert workflow.trace.succeeded().size() == 64 }
)
}

}

}
Loading