Skip to content

Commit

Permalink
limit size of component diffs for proptest (#29490)
Browse files Browse the repository at this point in the history
Proptests were taking too long, so we limited the test cases to 16. Better to limit the size of the component diffs instead. This took 8s locally.

GitOrigin-RevId: 1b1595509da9fbf5dae16843ab891db2b35bc097
  • Loading branch information
emmaling27 authored and Convex, Inc. committed Sep 3, 2024
1 parent e31eeac commit b7d6c25
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/model/src/deployment_audit_log/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ impl TryFrom<SerializedIndexDiff> for AuditLogIndexDiff {
)]
pub struct PushComponentDiffs {
pub auth_diff: AuthDiff,
#[cfg_attr(
any(test, feature = "testing"),
proptest(strategy = "prop::collection::btree_map(any::<ComponentPath>(), \
any::<ComponentDiff>(), 0..4)")
)]
pub component_diffs: BTreeMap<ComponentPath, ComponentDiff>,
}

Expand Down Expand Up @@ -546,11 +551,7 @@ impl TryFrom<PushComponentDiffs> for SerializedPushComponentDiffs {
}
}

codegen_convex_serialization!(
PushComponentDiffs,
SerializedPushComponentDiffs,
test_cases = 16
);
codegen_convex_serialization!(PushComponentDiffs, SerializedPushComponentDiffs);

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit b7d6c25

Please sign in to comment.