Quick question about how to properly do this for n...
# nf-test
m
Quick question about how to properly do this for nf-test. I want to have a default profile, and then also different profiles for different tests Example: In my
nf-test.config
file, I have these lines:
Copy code
config {
    // run all test with defined profile(s) from the main nextflow.config
    profile "test"
}
but in my module test, I want to test both singularity and docker containers, so I tried to do this:
Copy code
nextflow_process {

    name "Test Process DECOMPRESS_GENOME"
    script "modules/local/decompress_genome/decompress_genome.nf"
    process "DECOMPRESS_GENOME"

    // =========================================================================
    // SINGULARITY TEST
    // =========================================================================

    test("singularity | .fa.gz - decompresses to .fa") {

        options "-profile singularity"

        when {
            process {
                """
                input[0] = [
                    [ id: 'test_fa' ],
                    file("${projectDir}/modules/local/decompress_genome/TESTDATA/GCA_009858895.3_ASM985889v3_genomic.200409.fa.gz")
                ]
                """
            }
        }

        then {
            assert process.success

            // Output genome file exists and has expected extension
            assert process.out.genome.size() == 1
            assert process.out.genome[0][1].name.endsWith('.fa')
            assert process.out.genome[0][1].size() > 0

            // Metadata passthrough
            assert process.out.genome[0][0].id == 'test_fa'

            // versions.yml is emitted
            assert process.out.versions.size() == 1

            assert snapshot(process.out).match()
        }

    }

   // =========================================================================
    // DOCKER TEST
    // =========================================================================

    test("docker | .fa.gz - decompresses to .fa") {

        options "-profile docker"

        when {
            process {
                """
                input[0] = [
                    [ id: 'test_fa' ],
                    file("${projectDir}/modules/local/decompress_genome/TESTDATA/GCA_009858895.3_ASM985889v3_genomic.200409.fa.gz")
                ]
                """
            }
        }

        then {
            assert process.success

            // Output genome file exists and has expected extension
            assert process.out.genome.size() == 1
            assert process.out.genome[0][1].name.endsWith('.fa')
            assert process.out.genome[0][1].size() > 0

            // Metadata passthrough
            assert process.out.genome[0][0].id == 'test_fa'

            // versions.yml is emitted
            assert process.out.versions.size() == 1

            assert snapshot(process.out).match()
        }

    }
}
But in my test outputs
std.err
files I get this
Copy code
Can only specify option -profile once. -- Check the available commands and options and syntax with 'help'
Is there a way to append more profiles to individuals tests or is there a smarter way to do this overall?
e
Your nf-test command should look something like this:
nf-test test /path/to/main.nf.test --profile +singularity --verbose --update-snapshot
watch that `+`before singularity, it appends that to the existing
test
profile which is sourced by default on nf-core/modules