Skip to content

Add ignoreKeys and/or keepKeys to sanitizeOutput() #52

Description

@maxulysse

cf our slack convo (minus the emojis 😢):

Maxime:

OK, so how do I properly replace:

assertAll(
    { assert snapshot(
        workflow.out.collectEntries { key, val ->
            if(key.matches("\\d+")) {
                return null
            }
            if(key == "bam") {
                 return [key, val.collect { [it[0], bam(it[1]).readsMD5, file(it[2].toString()).name]}]
            }
            return [key, val]
        }.findAll { it != null }
    ).match() }
)

Nicolas:

You can't fully remove it but it can be simplified with the function:

assertAll(
    { assert snapshot(
        sanitizeOutput(workflow.out).collectEntries { key, val ->
            if(key == "bam") {
                return [key, val.collect { [it[0], bam(it[1]).readsMD5, file(it[2].toString()).name]}]
            }
            return [key, val]
        }
    ).match() }
)

I might look into supporting that in the future, I'll just need to find a way to properly do that

Maxime:

good enough for me for now
actually just some ignoreKeys or keepKeys would go a long way

Nicolas:

Good idea, could you open an issue an assign me?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions