Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Throw error when a snapshot with same id was created multiple time #188

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

lukfor
Copy link
Collaborator

@lukfor lukfor commented Jan 27, 2024

Throws an error when a user creates more than one unnamed snapshot or mutiple snapshots with the same id to avoid unexpected snapshot matching. Fixes #158

@lukfor lukfor merged commit d2508b2 into main Jan 27, 2024
12 checks passed
@lukfor lukfor deleted the features/snapshots-unique-id branch January 27, 2024 12:17
@RHReynolds
Copy link

RHReynolds commented Feb 2, 2024

@lukfor, is there a way we can allow for deliberate snapshot matching?

I've actually found it very useful to be able to have multiple tests refer to the same snapshot id. When testing a pipeline's logic, there will be times when skipping a process will impact files downstream of the process but not upstream. In this situation, it's been quite useful to group files that are expected to be unchanged into one snapshot id (which can be used across multiple tests) and those you expect to change. E.g.

{ assert snapshot(
                    path("$outputDir/cat/SAMPLE3_SE.merged.fastq.gz"),
                    path("$outputDir/pipeline_info/samplesheet.valid.csv")
                    ).match("common_files") 
                }

With the new modification, if I now want to check that the files I expect to be unchanged are truly unchanged across multiple test, I would have to manually compare md5s in the snapshot.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed snapshot validation with multiple snapshot assertions including a file list
2 participants