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

Add a feature to support proptest #56

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Add a feature to support proptest #56

merged 3 commits into from
Jan 15, 2025

Conversation

andrewjstone
Copy link
Contributor

Tested on an omicron branch.

Tested on an omicron branch.
andrewjstone added a commit to oxidecomputer/omicron that referenced this pull request Jan 11, 2025
This visitor walks a diffus generated diff and provides callbacks
for users to hook into the parts of the diff that they care about.

To keep things minimal, we don't provide callback trait methods for
copies (when nothing changes), and we don't provide methods for most
diffus_derive generated types (the ones that start with `Edited`).

We anticipate composing these visitors to build up a full diff of a
Blueprint. They can also be used individually as demonstrated with the
included property based test.

In order to easily generate `BlueprintZoneConfigs` for property tests we
derived `Arbitrary` for `BlueprintZoneConfigs` and its fields using the
`test-strategy` crate. Some of the types in the hierarchy don't actually
implement `Arbitrary` and they come from foreign crates. In this case a
corresponding generation strategy was added that allows those types to
be generated based on more primitive types that do implement arbitrary.

This PR is just one of many coming to build up and use automated
blueprint diffs. It builds on the following PRs which must be merged
in first:

 * oxidecomputer/newtype-uuid#56
 * oxidecomputer/diffus#8
Copy link
Collaborator

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

awesome!

@sunshowers sunshowers merged commit d424fbe into main Jan 15, 2025
5 checks passed
@sunshowers sunshowers deleted the proptest branch January 15, 2025 00:12
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.

2 participants