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

Prefer Operation instead of SyncOp in tests #431

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

djmitche
Copy link
Collaborator

This is a test-only change: all modified code is #[cfg(test)]

Lots of tests used SyncOp, including some proptests. One of those is moved out to tests/syncing-proptest.rs and updated to use Replicas intead of TaskDb's. op.rs remains in terms of SyncOp, since it defines that type, but converts to Operation for tests.

With their uses in tests removed, two apply_.. methods can finally be deleted.

This is the last "boring" change in #372. The next two will be breaking changes and have some open questions!

This is a test-only change: all modified code is `#[cfg(test)]`

Lots of tests used `SyncOp`, including some proptests. One of those is
moved out to `tests/syncing-proptest.rs` and updated to use Replicas
intead of TaskDb's. `op.rs` remains in terms of `SyncOp`, since it defines
that type, but converts to `Operation` for tests.

With their uses in tests removed, two `apply_..` methods can finally be
deleted.
@djmitche
Copy link
Collaborator Author

The one failing action here is #432 and not specific to this PR.

assert_eq!(t0, t1);
assert_eq!(t1, t2);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just out of curiosity, am I right to interpret the word "strategy" as "random choice" in the context of proptest? They use it pervasively in their docs and I'm not sure I know what they mean by it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, but it's not quite random - proptest has a bunch of mechanisms to help it focus down on problematic test cases, so it's more like a transformation from a bit string to a test case, where that bit string it built in "smart" ways.

@djmitche djmitche merged commit 624ee57 into GothenburgBitFactory:main Jul 26, 2024
11 of 12 checks passed
@djmitche
Copy link
Collaborator Author

Yeah, but it's not quite random - proptest has a bunch of mechanisms to help it focus down on problematic test cases, so it's more like a transformation from a bit string to a test case, where that bit string it built in "smart" ways.

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