Skip to content
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

[Feature] snapshot.matchStub() #168

Open
GallVp opened this issue Dec 21, 2023 · 0 comments
Open

[Feature] snapshot.matchStub() #168

GallVp opened this issue Dec 21, 2023 · 0 comments

Comments

@GallVp
Copy link

GallVp commented Dec 21, 2023

Hi Team

Thank you for the amazing work on nf-test.

Would it be possible to add automated output matching of a test against its own stub version where the only difference is that the stub version runs with the -stub option?

I have tried to do this manually for the nf-core/FASTP module here: nf-core/modules#4637 by create a snapshot out of the list of process outputs:

{
    assert snapshot(
        (
            [process.out.reads[0][0].toString()] + // meta
            process.out.reads.collect { file(it[1]).getName() } +
            process.out.json.collect { file(it[1]).getName() } +
            process.out.html.collect { file(it[1]).getName() } +
            process.out.log.collect { file(it[1]).getName() } +
            process.out.reads_fail.collect { file(it[1]).getName() } +
            process.out.reads_merged.collect { file(it[1]).getName() }
        ).sort()
    ).match("test_fastp_single_end-for_stub_match")
}

This can be abstracted into a function such as snapshot.matchStub(). It may also enable nf-test to partially auto generate stub code and suggest it to the tester. Such as:

touch ${prefix}.gff3
touch ${prefix}.report.html

...versions.yml...
@GallVp GallVp changed the title snapshot.matchStub() [Feature] snapshot.matchStub() Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant