Skip to content

Move Core-specific test utilities out of the Common crate - #1237

Merged
mjameswh merged 2 commits into
mainfrom
move-core-test-utils-out-of-common
Apr 28, 2026
Merged

mjameswh merged 2 commits into
mainfrom
move-core-test-utils-out-of-common

Conversation

@mjameswh

@mjameswh mjameswh commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Moved HistoryBuilder, HistoryInfo, test_utils.rs and canned histories out of the common create to the sdk-core crate.
  • Removed the history_builders and test-utilities features on the common crate.

Why

  • The content of those files is exclusively used by the sdk-core crate's internal tests. They are not meant for public usage.
  • Having them in the sdk-core crate makes it possible for HistoryBuilder and canned histories to have access to the InternalFlags enum.

@mjameswh
mjameswh marked this pull request as ready for review April 27, 2026 16:16
@mjameswh
mjameswh requested a review from a team as a code owner April 27, 2026 16:16
@mjameswh
mjameswh force-pushed the move-core-test-utils-out-of-common branch from bbc775c to 004d6b2 Compare April 27, 2026 17:21
Comment on lines +2394 to +2395
CoreInternalFlags::IdAndTypeDeterminismChecks as u32,
CoreInternalFlags::UpsertSearchAttributeOnPatch as u32,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@mjameswh
mjameswh force-pushed the move-core-test-utils-out-of-common branch from 004d6b2 to 415d0d2 Compare April 28, 2026 19:15
Comment thread crates/common/Cargo.toml
envconfig = ["dep:toml", "dep:dirs"]
serde_serialize = []
test-utilities = ["history_builders"]
core-telemetry-bridge = ["dep:ringbuf", "dep:futures-channel"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@chris-olszewski Note the casing inconsistency in serde_serialize vs other features.

# Exposes mocks and helpers used by sdk-core's own integration tests, benches,
# and the `histfetch` binary. Not part of the public API surface; downstream
# crates should not enable this feature.
test-utilities = ["dep:assert_matches", "dep:bimap"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a Rust convention for features that are not meant to be used publicly?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not that I know of. We could prefix with __ to make the name convey internal usage, but I don't think that is a widely used pattern.

@mjameswh
mjameswh force-pushed the move-core-test-utils-out-of-common branch from 415d0d2 to dfb0137 Compare April 28, 2026 19:28

@chris-olszewski chris-olszewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like some casts need to be removed, but LGTM

@mjameswh
mjameswh merged commit 6f7e753 into main Apr 28, 2026
37 of 38 checks passed
@mjameswh
mjameswh deleted the move-core-test-utils-out-of-common branch April 28, 2026 22:30
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