Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Aug 8, 2025

Fixes #1615

@cderv does this help clarify behviour?

@hadley hadley requested a review from cderv August 8, 2025 18:15
Copy link

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

It adds useful clarification about variants.

Just added a confirmation of my understand as the vignettes does not mention variant again.

If this is a deliberate change, you can follow the advice in the message and update the snapshots for that file by running `snapshot_accept("pizza")`; otherwise you can fix the bug and your tests will pass once more.
(You can also accept snapshot for all files with `snapshot_accept()`).

If you delete the test, the corresponding snapshot will be remove the next time you run the tests. If you delete all snapshots in the file, the entire snapshot file will be deleted the next time you run all the tests.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except when variants are used, right?
This is what I understood from the clarification in snapshot.R help addition.

In that case, the user is responsible for cleaning old, unused variants snapshot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you delete the entire test, then all the variants will be cleaned up. But testthat can't know if only one variant is never exercised any more, so it will never delete a single variant.

@hadley hadley merged commit abbd07d into main Aug 28, 2025
13 checks passed
@hadley hadley deleted the snapshot-cleanup branch August 28, 2025 16:19
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

Successfully merging this pull request may close these issues.

Add information about snapshot cleaning workflow in vignette, especially regarding variant

3 participants