Skip to content

Conversation

@kormide
Copy link
Contributor

@kormide kormide commented Dec 15, 2025

An example for working with insta snapshot tests. Includes a macro that stamps a rust_test along with an executable rule to update snapshots in the source tree.

@kormide kormide force-pushed the snapshot-test-example branch 4 times, most recently from 8976d22 to 18d4e9a Compare December 15, 2025 22:49
@kormide kormide marked this pull request as ready for review December 15, 2025 22:54
@kormide
Copy link
Contributor Author

kormide commented Dec 15, 2025

@illicitonion @UebelAndre

@kormide kormide force-pushed the snapshot-test-example branch from 18d4e9a to e40a919 Compare December 15, 2025 22:56
@kormide
Copy link
Contributor Author

kormide commented Dec 15, 2025

The CI failures are unclear to me. They don't appear to be caused by this example.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This generally looks reasonable (and useful!), but I'm not super sure of the value of this living in this repo... @UebelAndre any thoughts?

@kormide
Copy link
Contributor Author

kormide commented Dec 15, 2025

This generally looks reasonable (and useful!), but I'm not super sure of the value of this living in this repo... @UebelAndre any thoughts?

Yeah, it's a bit awkward that this solution is coupled to the nuances of insta. At some point I wanted to to do snapshot tests in rust and I couldn't find any examples. Searching rules_rust issues and examples was the first place I looked, so I figured it might go here.

If not, I'm happy to host it in an example repo of my own.

@kormide
Copy link
Contributor Author

kormide commented Dec 17, 2025

@alexeagle is there a home for this under aspect-build/bazel-examples?

@UebelAndre
Copy link
Collaborator

My initial thoughts on this are "is this demonstrating something unique that other rules examples do not?" and it seems like this is some handy rule but beyond that seems like a crate specific rule. I could see it becoming a crate_universe example but currently those in particular are more like integration tests that I don't think belong in examples (should instead be test/integration). Curious what @illicitonion thoughts are on the examples and if they should be cleaned up. If so then there's probably appetite for something like this.

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.

3 participants