Skip to content

Commit

Permalink
code polish
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Sep 20, 2024
1 parent dc788b4 commit 8550e6d
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 116 deletions.
28 changes: 14 additions & 14 deletions tests/default.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of tasks
workflow.trace.tasks().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name from which we remove files with stable contents
path_name_stable.collect{file -> file.getName()},
// All stable path name
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand All @@ -43,21 +43,21 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of tasks
workflow.trace.tasks().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name from which we remove files with stable contents
path_name_stable.collect{file -> file.getName()},
// All stable path name
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand Down
24 changes: 12 additions & 12 deletions tests/featurecounts_group_type.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -25,9 +25,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand All @@ -45,10 +45,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -57,9 +57,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand Down
24 changes: 12 additions & 12 deletions tests/hisat2.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -25,9 +25,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand All @@ -45,10 +45,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -57,9 +57,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand Down
24 changes: 12 additions & 12 deletions tests/kallisto.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -27,9 +27,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand All @@ -49,10 +49,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -61,9 +61,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand Down
24 changes: 12 additions & 12 deletions tests/min_mapped_reads.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -25,9 +25,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand All @@ -45,10 +45,10 @@ nextflow_pipeline {
}

then {
// path_name_stable: All files + folders in ${params.outdir}/ with a stable name
def path_name_stable = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// path_snapshottable: All files in ${params.outdir}/ with stable content
def path_snapshottable = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = UTILS.getAllFilesFromDir(params.outdir, true, UTILS.exclusionRegexesForUnstableFileNames)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = UTILS.getAllFilesFromDir(params.outdir, false, UTILS.exclusionRegexesForUnstableFileNames + UTILS_PIPELINE.exclusionRegexesForUnstableFileContents)
assertAll(
{ assert workflow.success},
{ assert snapshot(
Expand All @@ -57,9 +57,9 @@ nextflow_pipeline {
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"),
// All stable path name
path_name_stable.collect{file -> file.getName()},
stable_name.*name,
// All files with stable contents
path_snapshottable
stable_path
).match() }
)
}
Expand Down
Loading

0 comments on commit 8550e6d

Please sign in to comment.