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

Use full module path for test names #87

Merged
merged 5 commits into from
Jan 23, 2020

Conversation

max-sixty
Copy link
Sponsor Contributor

Closes #78

Is this the right design? A good case is the insta__test__embedded.snap change below. I suspect those cases are rare; though it's a breaking change where they do exist.

I need to adds a whatsnew

@mitsuhiko
Copy link
Owner

Something went wrong here

@max-sixty
Copy link
Sponsor Contributor Author

Fixed @mitsuhiko !

@mitsuhiko mitsuhiko merged commit 447ebf4 into mitsuhiko:master Jan 23, 2020
@max-sixty max-sixty deleted the module-path branch February 3, 2020 22:28
@imsnif
Copy link

imsnif commented Jun 18, 2020

Hey @mitsuhiko + @max-sixty, just a heads up: this introduced a breaking change. When upgrading insta, the old snapshots were not converted to the new format.

Not terrible, of course - it just required a bulk rename. Wanted to let you know so that maybe you'd like to document this somewhere or make insta "do the right thing" if it finds snapshots from the "old" mode.

Anyway, thanks very much for insta. It's been invaluable for me in various projects.

@max-sixty
Copy link
Sponsor Contributor Author

@imsnif thanks.

Do you have an example of a change in the snapshot format? This is some time ago so my memory is foggy, and I don't see any changes to our existing tests as part of this PR.

@imsnif
Copy link

imsnif commented Jun 18, 2020

Hey @max-sixty, sure.

What happened is that the snapshot file names changed for us. So we had to do a bulk rename. You can see the exact details of the name change in this comment: imsnif/diskonaut#25 (comment)

@max-sixty
Copy link
Sponsor Contributor Author

max-sixty commented Jun 18, 2020

Thanks a lot for the full description!

Was cargo-insta test --force-update-snapshots tried? That would have updated all snapshots, though (IIRC) not deleted the old ones. I've thought of that as an escape hatch for otherwise burdensome changes.

...and maybe we should make that option more obvious if you didn't know about it.

@imsnif
Copy link

imsnif commented Jun 19, 2020

Indeed did not know about it, but to be fair I didn't look too closely. :) Thanks!

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.

Tests inside 'test' mod pick up wrong name for snapshot name prefix
3 participants