mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 00:17:11 +00:00
refactor(site-replication): move business tests next to the service module (#6716)
* refactor(site-replication): move business tests next to the service module backlog#1840 PR5: 79 business-logic tests (plus 12 helpers, 6 of them small fixtures kept on both sides) move from the admin handler file's test module into rustfs/src/site_replication/tests.rs, next to the code they exercise: peer connection/TLS/DNS/egress validation, the peer client cache and payload wire contract, retry-queue classification/settlement/escalation/backoff, the repair state machine, bootstrap-plan construction, lifecycle expiry subsetting, bucket-target reconciliation, endpoint/identity normalization, and state serialization. The 149 tests that exercise the admin handlers, apply/reconcile paths, status/resync builders, and the four include_str! tripwires stay in rustfs/src/admin/handlers/site_replication.rs with their subjects (229 total conserved: 149 + 79 + 1). The issue's PR5 also called for converting the source-order tripwire at the old file's line 11339 into a behavior test; both adversarial review passes re-derived all four tripwires against the shrunken file and found them non-vacuous and byte-identical in the regions they guard (the handler bodies, which did not move), so they stay as source-text assertions. Supporting changes: the root facade's site_replication consumer gains cfg(test) re-exports (endpoint types, merge_incoming_replication_config, five lifecycle DTO types) so the relocated tests stay off the direct s3s/admin surfaces — including rewriting the one inline crate::admin BucketMetadata path a moved test carried over (review finding); tests.rs joins the logging-guardrail checked list; the embedded-secrets guard comment follows the validate_peer_connection_inner fixtures to their new file. Verified: cargo check -p rustfs --all-targets clean; cargo nextest run -p rustfs --lib 3856/3856 passed; relocated tests run under site_replication::tests::; make pre-commit green including the s3s footprint ratchet; logging and embedded-secrets guards green. Refs rustfs/backlog#1840 * style(site-replication): apply rustfmt import ordering
This commit is contained in:
@@ -88,7 +88,7 @@ PATTERNS=(
|
||||
# the guard fire again. Entries that stop matching anything are reported as
|
||||
# stale, so the list cannot decay into a blanket exclusion.
|
||||
#
|
||||
# 1-2: rustfs/src/admin/handlers/site_replication.rs negative fixtures for
|
||||
# 1-2: rustfs/src/site_replication/tests.rs negative fixtures for
|
||||
# `validate_peer_connection_inner`, which must reject a private key
|
||||
# submitted where a peer CA certificate is expected. Asserting on the
|
||||
# rejection requires the header in the input; the key bodies are the
|
||||
|
||||
Reference in New Issue
Block a user