Repository navigation
#39 — feat(examples): dogfooded playground fixture + matrix CI gate + unit_test format coverage - #63
Conversation
… unit_test format coverage Adds the richer cute-dbt example sourced from cmbays/dbt-playground#290 — a real dbt project with synthetic Synthea healthcare data. The fixture pair captures three modified models exercising in one report: - Multi-model in-scope cascade: mart_dq_summary, dim_payers, and int_dq_quarantine__encounters are all modified. - UNION arm rendering in two distinct patterns (encounter + medication metric UNION ALL; unknown-sentinel UNION ALL). - Multi-test-per-model: mart_dq_summary carries 2 unit tests; dim_payers carries 1. - Empty-state card: int_dq_quarantine__encounters is in scope but carries no unit tests targeting it. - dbt unit_test fixture-format diversity: the 3 unit tests in the playground span sql `given` + mixed dict/csv `expect` formats. Changes: - tests/fixtures/playground-{current,baseline}.json + MANIFEST.toml provenance entries (synthetic_only=true, origin=dbt-playground, sha256, license, description). - examples/playground-report.html committed (3.6MB) rendered from the fixture pair via the cute-dbt CLI. - .github/workflows/ci.yml example-report-up-to-date refactored to a matrix (jaffle-shop + playground) with a stable aggregator job presenting the existing branch-protection check name. Adding new examples now only requires adding a matrix row. - features/unit_test_format_coverage.feature + 4 BDD scenarios asserting cute-dbt renders unit_tests authored in dict / csv / sql formats uniformly. Feature count bumped 6 → 7 in ci.yml + lefthook (atomic mirror update). - book/src/examples.md + examples/README.md updated with the new playground example. Cross-repo coordination: - cmbays/dbt-playground#290 (private) adds the 3 unit_tests this fixture pair captures. The MANIFEST.toml origin_url pins to that commit SHA for provenance audit. Follow-ups tracked but out of scope: - dbt-autofix sweep on playground for fusion compatibility (separate playground PR). - Fusion-produced cross-engine fixture in cute-dbt. - Cross-join demo model (playground has none today). Verified locally: - cargo nextest run: 324 passed, 1 skipped - cargo test --test bdd: 7 features, 36 scenarios, 202 steps all passing (4 new scenarios) - cargo fmt --check, cargo clippy --all-targets -- -D warnings: clean - resource-ref lint: 17 passed (both jaffle-shop + playground HTML) - fixture-manifest-listed: all 7 fixtures listed with matching sha256 Closes #39. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…itted example The PR-D commit added examples/playground-report.html but left the zero-egress audit gates hardcoded to examples/jaffle-shop-report.html. That meant the new example shipped without: - the secondary structural lint (`tests/resource_ref_lint.rs`) - the PRIMARY runtime proof (`tests/headless_zero_egress.rs`) — the load-bearing auditability test that opens the report in real Chromium with DNS denied and asserts zero `Network.requestWillBeSent` events for http/https/ws/wss. Both tests are now keyed on a single `COMMITTED_EXAMPLES` array. Adding a new examples/<name>-report.html requires only appending its filename there (same shape as the .github/workflows/ci.yml matrix added in the parent commit). The headless test loops over examples inside a single Chrome instance (fresh tab per example, separate event capture per example) so the additional runtime cost is one extra tab, not an extra Chrome launch. Verified locally: - cargo test --test resource_ref_lint: 17 passed - cargo test --test headless_zero_egress -- --ignored: 1 passed (covers both jaffle-shop AND playground in 7.74s on a single launch) Surfaced by advisor pre-PR-open audit — exactly the kind of silent audit gap PR-Cβ taught us about. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 29 minutes and 35 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR introduces the dbt-playground example—a new fixture-driven, multi-format unit test coverage showcase with full BDD feature tests, generalized test infrastructure for multi-example validation, updated documentation, and restructured CI workflows. Changesdbt-playground Example and Test Coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'dbt-playground' example to demonstrate richer dbt features such as multi-model in-scope cascades, UNION-ALL rendering, and empty-state cards for modified models without unit tests. It also adds a new BDD feature to verify coverage for various dbt unit test fixture formats (dict, csv, sql). Feedback focuses on improving the robustness of the new tests by moving duplicated constants to a shared location, using structured HTML parsing instead of ad-hoc string containment, and deriving assertions from test data rather than hardcoding keywords.
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
…2cb38 cmbays/dbt-playground#290 squash-merged at 602cb38 (2026-05-25 04:58Z). Update both playground fixture entries' origin_url from the feat-branch HEAD dc1b08f to the merge commit. The fixture sha256s are unchanged — the manifests themselves are identical; only the provenance pointer moves to the stable merge commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rtion (Gemini disposition) Addresses 3 medium-severity findings from gemini-code-assist on PR #63. G-1 (resolved) — `COMMITTED_EXAMPLES` was duplicated in `tests/headless_zero_egress.rs` and `tests/resource_ref_lint.rs`. Moved the array to `tests/common/mod.rs` as `pub const`, along with the `example_path(filename)` helper. Both gates now reference a single source of truth — adding a new committed example only requires appending its filename in one place. G-2 + G-3 (resolved) — the `that model's section indicates zero unit tests are wired` step matched a loose union of keyword variations (`html.contains("0 unit tests wired") || .contains("No unit tests") || .contains("no unit tests")`). The assertion would pass if the copy appeared anywhere on the page, not just on the named model's card. Rewrote all 4 `Then` steps to parse the embedded `<script id="cute-dbt-data">` JSON payload via `tl` + `serde_json` and assert structurally: - "contains the unit test X" → find X across all models' `tests` arrays; stash the owning model name in `World.last_named_model`. - "that unit test names the target model X" → compare the stashed owner to X (no double regex match needed). - "contains a section for the model X" → look up the model in the payload by name; stash the name. - "that model's section indicates zero unit tests are wired" → assert the stashed model's `tests` array is empty. Per-model assertions now correctly scope to the named model, not the whole document. Verified locally: - cargo test --test bdd: 7 features, 36 scenarios, 202 steps passing - cargo test --test resource_ref_lint: 17 passed - cargo test --test headless_zero_egress -- --ignored: 1 passed (covers both jaffle-shop + playground in one Chrome launch) - cargo fmt --check, cargo clippy --all-targets -- -D warnings: clean - cargo nextest run: 324 passed, 1 skipped Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@coderabbitai review The original review was rate-limited at 04:56Z. Three commits have landed since then with |
|
✅ Actions performedFull review triggered. |
Summary
The richer cute-dbt example sourced from cmbays/dbt-playground — a real healthcare-analytics dbt project on synthetic Synthea data. The fixture pair captures three modified models in one diff and exercises 4 of the 4 at-least-one criteria in issue #39:
mart_dq_summary; unknown-sentinel UNION ALL indim_payers)mart_dq_summarycarries 2 unit tests;dim_payerscarries 1int_dq_quarantine__encountersis in scope but has 0 unit tests targeting itPlus a bonus the issue didn't ask for: the 3 unit tests in the playground PR span dbt's three fixture formats (
sqlgiven + mixeddict/csvexpect), andfeatures/unit_test_format_coverage.featurepins cute-dbt's renderer against all three.Closes #39.
Cross-repo coordination — READ ME
This PR pairs with cmbays/dbt-playground#290, which adds the 3 unit_tests captured in this fixture pair. Both PRs should be reviewed together:
dbt compilemanifest snapshots as cute-dbt fixtures, plus a synthetic local-only body-modification overlay on three models to trip the StateComparator (the overlay is NOT committed to the playground).tests/fixtures/MANIFEST.tomlorigin_urlcurrently pins to the playground feat-branch HEADdc1b08ffor traceable provenance. Once playground#290 squash-merges, theorigin_urlentries will be updated to the merge commit SHA in a follow-up commit before this PR merges. That's intentional, not stale.What ships
tests/fixtures/playground-{current,baseline}.jsontests/fixtures/MANIFEST.tomlexamples/playground-report.html.github/workflows/ci.ymlexample-report-up-to-daterefactored to a matrix (jaffle-shop + playground). Stable aggregator job retains the existing branch-protection check name (Example report is byte-identical to renderer output).features/unit_test_format_coverage.feature+tests/steps/unit_test_format_coverage.rstests/{resource_ref_lint,headless_zero_egress}.rsCOMMITTED_EXAMPLESarray. The PRIMARY runtime proof (headless Chrome + DNS denied) covers BOTH examples in one launch (~7.7s).book/src/examples.md+examples/README.mdTest plan
cargo nextest run— 324 passed, 1 skippedcargo test --test bdd— 7 features, 36 scenarios, 202 steps all passing (4 new)cargo test --test resource_ref_lint— 17 passed (incl. new matrix lint)cargo test --test headless_zero_egress -- --ignored— 1 passed (covers BOTH examples in 7.74s)cargo fmt --check,cargo clippy --all-targets -- -D warnings— cleancargo test --test fixture_manifest_listed— 3 passed (every fixture listed with matching sha256)lefthookpre-push gates — greenorigin_urlSHA update post playground#290 mergeFollow-ups (tracked, out of scope)
src/adapters/cte_engine.rsunit tests).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation