Primarily for you, <@UEM37TBAR>, but also anyone: ...
# meta-omics
d
Primarily for you, @James Fellows Yates, but also anyone: I understood you as saying that your preferred way of writing tests without duplicating the config specified tests would be to just add
profile "test"
and params etc would be pulled in from the config. This sounded perfect to me, as we can keep the config tests for development command line testing without having to duplicate things. But the below didn't work:
Copy code
nextflow_pipeline {

    name "Test pipeline"
    script "../main.nf"
    tag "pipeline"
    profile "test"

    test("-profile test") {

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

        then {
            // stable_name: All files + folders in ${params.outdir}/ with a stable name
            def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
            // stable_path: All files in ${params.outdir}/ with stable content
            def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
            assertAll(
                { assert workflow.success},
                { assert snapshot(
                    // Number of successful tasks
                    workflow.trace.succeeded().size(),
                    // pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
                    removeNextflowVersion("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml"),
                    // All stable path name, with a relative path
                    stable_name,
                    // All files with stable contents
                    stable_path
                ).match() }
            )
        }
    }
}
I get complaints about missing mandatory params that are defined in
conf/test.config
.
Copy code
Nextflow stdout:
  
  Provide either `--assembler` or `--user_assembly`!
What did I misunderstand? Is there a config thing I need to fix? (The code is the
dev
branch of metatdenovo, except for the above.)