-
Notifications
You must be signed in to change notification settings - Fork 36
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 init #73
Merged
Merged
nf-test init #73
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7900b05
build: Run nf-test init
edmundmiller 8267111
test(bclconvert): Add initial test
edmundmiller 9efc4c1
test(bases2fastq): Add initial test
edmundmiller 178e315
test(bcl2fastq): Add initial test
edmundmiller 0c86300
chore: Update CHANGELOG
edmundmiller 3070bc0
chore: Make CHANGELOG consistant
edmundmiller 87a600a
ci: Yoink pipeline from fetchngs
edmundmiller 4f89ea6
docs: Add nf-test badge to README
edmundmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,98 @@ | ||
name: nf-core CI | ||
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- dev | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
NXF_ANSI_LOG: false | ||
|
||
# Cancel if a newer run is started | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Run pipeline with 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/demultiplex') }}" | ||
changes: | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# Expose matched filters as job 'modules' output variable | ||
tags: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: "tests/config/tags.yml" | ||
|
||
test_changes: | ||
name: ${{ matrix.tags }} ${{ matrix.component }} ${{ matrix.profile }} ${{ matrix.NXF_VER }} | ||
runs-on: ubuntu-20.04 | ||
needs: changes | ||
if: needs.changes.outputs.tags != '[]' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
NXF_VER: | ||
- "21.10.3" | ||
- "latest-everything" | ||
test: | ||
- "test_bclconvert" | ||
- "test_bcl2fastq" | ||
- "test_bases2fastq" | ||
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"] | ||
profile: ["docker"] # TODO Add singularity/conda | ||
component: ["pipeline"] # TODO There aren't any subworkflows or modules tests YET | ||
exclude: | ||
- NXF_VER: "latest-everything" | ||
profile: "conda" | ||
steps: | ||
- name: Check out pipeline code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Nextflow | ||
uses: nf-core/setup-nextflow@v1 | ||
- uses: actions/cache@v2 | ||
with: | ||
version: "${{ matrix.NXF_VER }}" | ||
path: /usr/local/bin/ | ||
key: ${{ runner.os }} | ||
restore-keys: | | ||
${{ runner.os }}-nextflow- | ||
|
||
- name: Run pipeline with test data | ||
- name: Install Nextflow | ||
env: | ||
CAPSULE_LOG: none | ||
run: | | ||
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test }},docker --outdir ./results | ||
wget -qO- get.nextflow.io | bash | ||
sudo mv nextflow /usr/local/bin/ | ||
|
||
- name: Install nf-test | ||
run: | | ||
wget -qO- https://code.askimed.com/install/nf-test | bash | ||
sudo mv nf-test /usr/local/bin/ | ||
|
||
- name: Set up Singularity | ||
if: matrix.profile == 'singularity' | ||
uses: eWaterCycle/setup-singularity@v5 | ||
with: | ||
singularity-version: 3.7.1 | ||
|
||
- name: Set up miniconda | ||
if: matrix.profile == 'conda' | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
channels: conda-forge,bioconda,defaults | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Conda clean | ||
if: matrix.profile == 'conda' | ||
run: conda clean -a | ||
|
||
- name: Run nf-test | ||
run: nf-test test --profile=test,${{ matrix.profile }} tests/${{ matrix.component }}/${{ matrix.tags }}/*.nf.test --junitxml=${{ matrix.tags }}.xml | ||
|
||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() # always run even if the previous step fails | ||
with: | ||
report_paths: "${{ matrix.tags }}.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ results/ | |
testing/ | ||
testing* | ||
*.pyc | ||
.nf-test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
repository_type: pipeline | ||
lint: | ||
actions_ci: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
config { | ||
|
||
testsDir "tests" | ||
workDir ".nf-test" | ||
configFile "nextflow.config" | ||
profile "test" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
default: | ||
- bin/** | ||
- conf/** | ||
- lib/** | ||
- modules/** | ||
- subworkflows/** | ||
- tests/** | ||
- workflows/** | ||
- nextflow.config | ||
- main.nf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test Bases2Fastq" | ||
script "main.nf" | ||
|
||
test("Should run without failures") { | ||
|
||
when { | ||
params { | ||
input = "$baseDir/assets/inputs/b2fq-samplesheet.csv" | ||
demultiplexer = 'bases2fastq' | ||
outdir = "$outputDir" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert workflow.trace.succeeded().size() == 6 | ||
|
||
assert snapshot( | ||
path("$outputDir/sim-data/DefaultSample_R1.fastq.gz.md5"), | ||
path("$outputDir/sim-data/DefaultSample_R2.fastq.gz.md5"), | ||
path("$outputDir/sim-data/Metrics.csv"), | ||
path("$outputDir/sim-data/RunManifest.json"), | ||
path("$outputDir/sim-data/UnassignedSequences.csv"), | ||
|
||
path("$outputDir/sim-data/Samples/DefaultSample/DefaultSample_R1.fastq.gz"), | ||
path("$outputDir/sim-data/Samples/DefaultSample/DefaultSample_R2.fastq.gz"), | ||
).match() | ||
|
||
assert new File("$outputDir/sim-data/Bases2Fastq-Sim_QC.html").exists() | ||
assert new File("$outputDir/sim-data/RunStats.json").exists() | ||
assert new File("$outputDir/sim-data/Samples/DefaultSample/DefaultSample_stats.json").exists() | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Should run without failures": { | ||
"content": [ | ||
"DefaultSample_R1.fastq.gz.md5:md5,5d8bc31e54f78babafb9a860be2ff52a", | ||
"DefaultSample_R2.fastq.gz.md5:md5,1b71d1475ec7fb7e7ca16b7958990622", | ||
"Metrics.csv:md5,3213ad7bdf66f33476cb589b4d608948", | ||
"RunManifest.json:md5,d4ecdb19e5fbcffab3e6e770c34023fb", | ||
"UnassignedSequences.csv:md5,11c1693830ce941b8cfb8d2431a59097", | ||
"DefaultSample_R1.fastq.gz:md5,77b68ec94323741d1bddc03a7a428fa9", | ||
"DefaultSample_R2.fastq.gz:md5,ecd4ed53e10207582bbbc29383080b57" | ||
], | ||
"timestamp": "2022-11-24T01:47:50+0000" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test bcl2fastq" | ||
script "main.nf" | ||
|
||
test("Should run without failures") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir" | ||
input = "${baseDir}/assets/inputs/flowcell_input.csv" | ||
demultiplexer = 'bcl2fastq' | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert workflow.trace.succeeded().size() == 5 | ||
|
||
assert snapshot( | ||
path("$outputDir/220422_M11111_0222_000000000-K9H97/Sample1_S1_L001_R1_001.fastq.gz.md5"), | ||
|
||
path("$outputDir/bcl2fastq/Sample1_S1_L001_R1_001.fastq.gz"), | ||
path("$outputDir/bcl2fastq/Stats").list(), | ||
).match() | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"Should run without failures": { | ||
"content": [ | ||
"Sample1_S1_L001_R1_001.fastq.gz.md5:md5,2ffef70ffda3328c3c6607bf14ca50c3", | ||
"Sample1_S1_L001_R1_001.fastq.gz:md5,e92fce7b86c6447b053d72c5cb4be89c", | ||
[ | ||
"AdapterTrimming.txt:md5,48ed2b914b1246c0b5d8667525550946", | ||
"ConversionStats.xml:md5,8fe0f57f3f5d256a0762dba75ac62d05", | ||
"DemultiplexingStats.xml:md5,2047ff18f5b9107c084de06e9ff943ad", | ||
"DemuxSummaryF1L1.txt:md5,03e5fd0c1e3079c5f8c7b4d0501b37ff", | ||
"FastqSummaryF1L1.txt:md5,0c6f2d87ee183b84d1051cde9a5643d1", | ||
"Stats.json:md5,8e5f038b8aa9e465599d3575f930e604" | ||
] | ||
], | ||
"timestamp": "2022-11-24T01:58:20+0000" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test bclconvert" | ||
script "main.nf" | ||
|
||
test("Should run without failures") { | ||
|
||
when { | ||
params { | ||
input = "$baseDir/assets/inputs/flowcell_input.csv" | ||
demultiplexer = 'bclconvert' | ||
outdir = "$outputDir" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert workflow.trace.succeeded().size() == 5 | ||
|
||
assert snapshot( | ||
path("$outputDir/220422_M11111_0222_000000000-K9H97/Sample1_S1_L001_R1_001.fastq.gz"), | ||
path("$outputDir/220422_M11111_0222_000000000-K9H97/Sample1_S1_L001_R1_001.fastq.gz.md5"), | ||
path("$outputDir/220422_M11111_0222_000000000-K9H97/Undetermined_S0_L001_R1_001.fastq.gz"), | ||
path("$outputDir/220422_M11111_0222_000000000-K9H97/L001/Reports/").list(), | ||
).match() | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we keep the naming conventions from pytest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sateeshperi and I thought it would be good to follow whatever
nf-test generate
spit out. But I'm guessing beyond the basic tests the naming will be out the window, and I don't want people to get caught up in following a convention when they could have an excellent name for a specific test.Something we can circle back around to, though!