You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share the telemetry-consent test harness between wxc_common and mxc_ffi #690
src/ffi/mxc_ffi/src/lib.rs carries its own copy of the telemetry-consent test harness — a CONSENT_ENV_LOCK mutex and a LocalAppDataGuard that redirects the consent store to a temp directory — duplicating the equivalent harness in src/core/wxc_common/src/telemetry/consent.rs.
This is structural rather than an oversight: wxc_common::telemetry::consent::test_support is #[cfg(test)] pub(crate), so it is not compiled into wxc_common when that crate is built as a dependency, and mxc_ffi therefore cannot reference it.
Sharing it requires exposing the harness behind a cargo feature:
Add a test-support feature to wxc_common.
Gate telemetry::consent::test_support on #[cfg(any(test, feature = "test-support"))] and make it pub rather than pub(crate).
Add wxc_common = { workspace = true, features = ["test-support"] } to mxc_ffi's [dev-dependencies].
Delete the duplicate harness from mxc_ffi and re-point its consent tests at the shared one.
The feature must stay off by default so the harness never reaches a shipping build.
Additional context
Raised as a Low finding during the adversarial review of the telemetry consent work, and noted again in docs/telemetry/telemetry-consent-design.md §12 under "Known gaps". Test-only scaffolding, no shipped behavior at risk — but it is duplicated logic across crates, which the consent work otherwise set out to eliminate.
This is a Rust refactoring task to expose wxc_common's telemetry-consent test harness behind a test-support cargo feature so mxc_ffi can share it instead of duplicating it. Needs-Triage has been removed.
Addressed by the landed telemetry stack. PR #819 added the opt-in wxc_common/test-support feature, and PR #821 exposed the shared wxc_common::telemetry::test_support::TelemetryTestEnv, enabled it for mxc_ffi dev tests, and redirected the FFI consent tests to that shared harness. The remaining local FFI wrapper only owns the temporary directory; it no longer duplicates the consent lock or LocalAppDataGuard.
Activity
github-actions commentedon Jul 27, 2026
Triage complete.
Area-Build-Rust@bbonaby(Rust build)This is a Rust refactoring task to expose
wxc_common's telemetry-consent test harness behind atest-supportcargo feature somxc_ffican share it instead of duplicating it.Needs-Triagehas been removed.RamonArjona4 commentedon Sep 22, 2026
Addressed by the landed telemetry stack. PR #819 added the opt-in
wxc_common/test-supportfeature, and PR #821 exposed the sharedwxc_common::telemetry::test_support::TelemetryTestEnv, enabled it formxc_ffidev tests, and redirected the FFI consent tests to that shared harness. The remaining local FFI wrapper only owns the temporary directory; it no longer duplicates the consent lock orLocalAppDataGuard.