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
Gate tracker-core's test modules and mocks (#2482 subissue 3) #2681
Subissue 3 of sub-EPIC #2482 (Reorganize test support code shared between workspace packages), itself a sub-EPIC of EPIC #1669 (Overhaul: Packages). It applies rules C and D of the ADR docs/adrs/20261021190318_share_workspace_test_support_through_testing_features.md to tracker-core, and it is the first row that adds a testing feature to a real crate, so the Shipped Features job of #2670 finally has something to check.
Goal
Make tracker-core's crate-private test helper modules private, and compile the one mock that other packages' tests use (MockTorrentMetricsStore) only behind a non-default testing feature, so mockall leaves tracker-core's normal dependencies and no Mock* type is in its default public API.
Why
lib.rs and whitelist/mod.rs declare pub mod peer_tests; and pub mod test_helpers; although their content is #[cfg(test)], which adds empty public modules to the API. The four #[automock] database traits make mockall a normal dependency and put four Mock* types in the public API, but only MockTorrentMetricsStore is used by other packages (http-core and udp-core unit tests). The other three are crate-private test support and use cfg_attr(test, automock) (rule D.2).
Tasks
T1: record the baseline (dependency tree and test counts) and audit the other normal dependencies.
T2: rule C: make the three helper modules private.
T3: rule D.2: the three crate-private mocks use cfg_attr(test, automock).
T4: rule D: gate MockTorrentMetricsStore behind testing with an optional mockall, the path-only self dev-dependency, the deny.toml wrapper entry and the consumers' dev-dependency entries.
T5: verify (builds without the feature, tests with and without --all-features, Shipped Features red and green, coupling labels, packaging).
Reopened by the #2482 coordinator: spec-only PR #2682 closed this issue by accident. Its body said the implementation PR "will close" the issue, and the maintainer merge tool copies the PR body into the merge commit, so GitHub applied the closing keyword. The implementation PR is still to come and will close it.
Activity
docs(issues): [torrust#2681] move the feature-enabled build checkpoin…
docs(issues): [torrust#2681] compare doc tests with matching baseline…
docs(issues): [torrust#2681] verify mockall is absent from the consum…
docs(issues): [torrust#2681] correct the coupling-report scenario to …
docs(pr-reviews): [torrust#2681] record the review of PR 2682
docs(issues): [torrust#2681] record the spec-only branch in the issue…
docs(pr-reviews): [torrust#2681] record the second and third Copilot …
docs(issues): [#2681] specify gating the tracker-core test modules an…
josecelano commentedon Oct 28, 2026
Reopened by the #2482 coordinator: spec-only PR #2682 closed this issue by accident. Its body said the implementation PR "will close" the issue, and the maintainer merge tool copies the PR body into the merge commit, so GitHub applied the closing keyword. The implementation PR is still to come and will close it.
12 remaining items
refactor(tracker-core): [#2681] make the crate-private test helper mo…
refactor(tracker-core): [#2681] generate the crate-private database m…
refactor(tracker-core): [#2681] put the torrent metrics mock behind a…
docs(issues): [#2681] mark inventory patterns C and D resolved
docs(adrs): [#2681] narrow rule D.1 to the mock other packages use
docs(issues): [#2681] record the manual verification evidence
docs(tracker-core): [#2681] explain the testing mock, the self wrappe…
docs(issues): [#2681] record the pre-PR review, the completion review…
Merge torrust#2688: refactor(tracker-core): [torrust#2681] gate the t…
docs(pr-reviews): [torrust#2681] record the post-merge finding F10 of…
docs(issues): [torrust#2681] fix the chronological order of the row-3…
chore(issues): archive closed issue #2681 spec to docs/issues/closed
Merge #2689: chore(issues): archive closed issue #2681 spec to docs/i…
Merge #2711: refactor(udp-server): [#2699] gate the test environment …