test: land RFC0001.10 (ts preserved) + §3.7.3 (per-ResourceLogs tenant), relocated - #168
Conversation
…t), relocated Both behaviours already exist; this lands their RFC 0001 §5 acceptance criteria as integration tests in the crates that can exercise them and removes the misplaced miner-crate stubs (same pattern as RFC0001.5/.6 and H5.3). RFC0001.10 (`time_unix_nano` preserved verbatim) → ourios-querier: an end-to-end ingest → Parquet → query scenario. A row written at the §5 instant is returned by a `range(...)` query straddling it, and the value read back via `ourios_parquet::Reader` equals the wire input byte-for-byte (a pass-through field). Lives in crates/ourios-querier/tests/rfc0001_time_preserved.rs; the miner crate can run neither the Parquet write nor a query. §3.7.3 (tenant derivation runs per `ResourceLogs`) → ourios-ingester: one ExportLogsServiceRequest with two ResourceLogs resolving to distinct tenants a/b is driven through the receiver pipeline; each group's records are mined under their own tenant with no cross-contamination. Lives in crates/ourios-ingester/tests/invariant_3_7_3_tenant_per_resource_logs.rs — a receiver/RFC 0003 §6.3 behaviour the miner crate cannot drive (its own stub comment anticipated this relocation). The two miner stubs (`#[ignore]`/`todo!()`) become one-line pointer comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 46 minutes and 14 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR relocates two integration test scenarios from placeholder stubs in the miner crate to complete end-to-end implementations: tenant derivation validation moves to the ingester layer, and RFC0001 time preservation validation moves to the querier layer. Miner stubs are removed and replaced with comments explaining the relocation rationale. ChangesTenant Derivation Per ResourceLogs
RFC0001 Time Preservation Across Pipeline
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Pull request overview
Adds integration coverage for two already-implemented behaviors from RFC 0001 / multi-tenancy invariants by landing new end-to-end tests in the appropriate crates, and replaces misplaced miner-crate red-gate stubs with pointer comments.
Changes:
- Add
ourios-querierintegration test assertingtime_unix_nanois preserved through Parquet and that a DSLrange(...)query returns the expected row (RFC0001.10). - Add
ourios-ingesterintegration test asserting tenant derivation is performed perResourceLogsgroup throughout the ingest pipeline (Invariant §3.7.3 / RFC 0003 §6.3). - Relocate miner-crate ignored stubs to one-line pointers to the new test locations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/ourios-querier/tests/rfc0001_time_preserved.rs | New querier end-to-end test for RFC0001.10 (time_unix_nano preservation + range query). |
| crates/ourios-miner/tests/rfc_internal.rs | Removes RFC0001.10 ignored stub; replaces with pointer to querier test. |
| crates/ourios-miner/tests/invariants.rs | Removes §3.7.3 ignored stub; replaces with pointer to ingester test. |
| crates/ourios-ingester/tests/invariant_3_7_3_tenant_per_resource_logs.rs | New ingester test asserting per-ResourceLogs tenant derivation through WAL + miner fan-out. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ld-independent The per-tenant template_count==2 assertion sat near the §6.2 similarity threshold; make the two within-tenant lines clearly dissimilar so each mines its own template regardless of widening config — the §3.7.3 scenario is tenancy, not widening. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…x [lo,hi) notation Add an AT_HI control at the exclusive upper bound, whose hour partition overlaps the window, so it is excluded only by the half-open row-level ts<end predicate (not the partition prune) — the prior hour-earlier control was partition-pruned. Correct the doc bracket to half-open [lo,hi). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lands two RFC 0001 §5 acceptance criteria as integration tests and relocates their misplaced miner-crate stubs. Both behaviours already exist — this is tests + stub relocation only; no production code changes. Same pattern as the already-relocated RFC0001.5/.6 (query semantics → ourios-querier) and H5.3 (drift → ourios-querier).
Criterion 1 — RFC0001.10 (
time_unix_nanopreserved verbatim) → ourios-queriertime_unix_nanois a pass-through field (MinedRecord.time_unix_nano), so the §5 scenario is an end-to-end ingest → Parquet → query check that the miner crate cannot run (it can run neither the Parquet write nor a query).The test (
crates/ourios-querier/tests/rfc0001_time_preserved.rs):1_715_700_000_000_000_000(plus an hour-earlier control) via the sharedtests/commonfixtures (simple/write_all, which lay down real Parquet throughourios-parquet);range(...)query whose window (2024-05-13T11:33:20Z .. 2024-05-15T19:06:40Z, the RFC §5 bounds in RFC3339 —rangetakes RFC3339/duration/now, not bare nanos) straddles the instant, viaQuerier::run_query, and asserts exactly the in-window row is returned (control excluded). Gates benchmarks B1.ourios_parquet::Readerand asserts the storedtime_unix_nanoequals the wire input byte-for-byte.Criterion 2 — §3.7.3 (tenant derivation runs per
ResourceLogs) → ourios-ingesterCLAUDE.md§3.7 / RFC 0003 §6.3: the receiver derivestenant_idonce perResourceLogs, not per export batch. This is a receiver/pipeline behaviour the miner crate cannot drive — the miner-side stub's own comment already anticipated the move ("lives with RFC 0003 once the receiver crate exists").The test (
crates/ourios-ingester/tests/invariant_3_7_3_tenant_per_resource_logs.rs):ExportLogsServiceRequestwith twoResourceLogswhoseservice.nameresource attrs resolve (defaultTenantRule::service_name()) to tenantsaandb, two records each;IngestPipeline(real WAL + aMinerClusterwired with aSharedRecordSink) viaingest;ResourceLogsgroup's records are mined under their own tenant (drained sink, partitioned bytenant_id), that no record is cross-tagged (each carries its Resource'sservice.name), and that each per-tenant tree holds exactly its own two templates (template_count).The receiver-side fan-out is also covered by RFC0003.3; this scenario carries it the rest of the way, through the miner, to prove no record lands in the wrong tenant's tree.
Stub relocation
crates/ourios-miner/tests/rfc_internal.rs::rfc0001_10_…(#[ignore]+todo!()) → one-line pointer comment.crates/ourios-miner/tests/invariants.rs::invariant_3_7_3_…(#[ignore]+todo!()) → one-line pointer comment.Invariants touched
§3.7 (multi-tenancy is not bolted on): the §3.7.3 test is a direct positive assertion of per-
ResourceLogstenant scoping with a no-cross-contamination guard — it strengthens, not weakens, the invariant. No production code changed.Verification
cargo fmt --all --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo test --all-featuresall pass locally: 587 passed, 0 failed, 26 ignored (the two relocated stubs no longer among the ignored). No benchmarks touched.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes