Skip to content

chore(tesseract): additional integration tests - #10969

Merged
waralexrom merged 2 commits into
masterfrom
tesseract-additional-tests
May 29, 2026
Merged

waralexrom merged 2 commits into
masterfrom
tesseract-additional-tests

Conversation

@waralexrom

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added the rust Pull requests that update Rust code label May 29, 2026
@waralexrom
waralexrom force-pushed the tesseract-additional-tests branch from c982a5b to b138d01 Compare May 29, 2026 09:19
@claude

claude Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @waralexrom's task in 2m 12s —— View job


Claude Code Review

Verdict: changes look sound overall. 0 high, 2 medium, 2 low — see inline comments.

Details

Todos

  • Gather PR context
  • Review changed files (diff vs origin/master)
  • Check for stale review threads (none)
  • Post review findings

Scope

36 files, test-only: new integration tests (calc groups, chained subquery, subquery-in-join, rolling-window gaps, multi-stage rank graph, multiplied dim-only ME, cross-cube fanout), new YAML schemas + seeds, and infra: custom_sql_templates is now carried through for_options rebuilds in test_context.rs (good fix — previously a non-UTC timezone request would silently drop the generated_time_series templates).

Findings

Medium

  • tests/integration/multi_stage/reduce_by.rs: assert_uses_window / assert_no_window and ~6 surrounding tests were stripped; surviving cases reduced to build_sql(...).unwrap();. Loses the documented window-path vs JOIN-model contract. Was this deliberate? (inline)
  • snapshots/...db_ts_rolling_with_dimension.snap: query only orders by orders.category; within each category created_at_day rows are interleaved unpredictably. Snapshot will be flaky — add a secondary ORDER BY in the test. (inline)

Low

  • integration_multi_stage.yaml adjusted_amount: commented-out filters: block — delete or enable. (inline)
  • mock_driver_tools.rs with_sql_templates_and_timezone: #[allow(dead_code)] no longer needed. (inline)

Praise

  • Excellent regression annotations on every new test (citing the matching JS sql-generation case, the bug it exercises, expected numbers on the seed data).
  • #[ignore] cases for test_aggregating_cross_cube_measure_with_fanout_dim and test_source_product_category_cross_join come with crisp FIXMEs that capture the join-root / column-projection root causes — easy to pick up later.
  • custom_sql_templates carry-through in test_context.rs has a clear doc comment explaining why a for_options rebuild was previously dropping templates.

Not reviewed

  • Did not run cargo test or cargo build.
· branch: `tesseract-additional-tests`


let sql = ctx.build_sql(query).unwrap();
assert_uses_window(&sql);
ctx.build_sql(query).unwrap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert_uses_window / assert_no_window helpers and ~6 whole tests around them were stripped, and the surviving cases were reduced to ctx.build_sql(query).unwrap(); with the SQL-shape assertions removed. Those assertions documented a non-trivial planner contract (when reduce_by routes through the window-path vs the JOIN-model), and the deleted comments around each test were the only place that contract was written down.

If the contract still holds, the assertions should come back. If the planner intentionally no longer makes that distinction, please call that out in the PR description — silently dropping behavioral assertions makes this look like a coverage regression rather than a deliberate change.

Fix this →

electronics | 2024-01-15 00:00:00 | 350.00
electronics | 2024-01-20 00:00:00 | 120.00
electronics | 2024-01-14 00:00:00 | 550.00
electronics | 2024-01-13 00:00:00 | 550.00

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This snapshot is non-deterministic in row order. The query (db_time_series.rs:94) only orders by orders.category; within each category the created_at_day rows are interleaved unpredictably (e.g. books: 10, 13, 19, 17, 18, 20, 12, 16, 15, 14, 11). Postgres is free to return them in any order absent an explicit second ORDER BY key, and the previous snapshot happened to be sorted only by coincidence of the prior plan.

This will be a flaky-test source. Add orders.created_at (or the day alias) as a secondary order key in the test query before re-baselining.

Fix this →

Comment on lines +256 to +258
multi_stage: true
sql: "{CUBE.total_amount} + 0.1 * {CUBE.date_rank}"
# filters:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead commented-out filters: block on adjusted_amount. Either delete it or, if the filter is supposed to be part of the repro shape, uncomment it and re-baseline. Leaving it commented makes it unclear whether the JS scenario this is mirroring required the filter or not.

}
}

#[allow(dead_code)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: #[allow(dead_code)] is no longer needed — with_sql_templates_and_timezone is called from test_context.rs::new_with_options_internal.

@codecov

codecov Bot commented May 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.85%. Comparing base (76eb75b) to head (7c139ae).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10969   +/-   ##
=======================================
  Coverage   78.85%   78.85%           
=======================================
  Files         470      470           
  Lines       93388    93388           
  Branches     3466     3466           
=======================================
  Hits        73640    73640           
  Misses      19245    19245           
  Partials      503      503           
Flag Coverage Δ
cube-backend 58.43% <ø> (ø)
cubesql 83.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude

claude Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @waralexrom's task in 41s —— View job


Claude Code Review — follow-up on 7c139ae

Verdict: prior round of feedback fully addressed. 0 high, 0 medium, 0 low on the delta.

Details

Todos

  • Diff b138d01..HEAD to see what 7c139ae changed
  • Re-check each of the four prior findings against the new commit
  • Spot-check restored assertions and stabilized snapshot

Resolution of prior findings

  • Medium — reduce_by tests stripped: assert_uses_window / assert_no_window helpers restored, surrounding tests restored with explicit window/JOIN-model assertions and clear regression-doc comments (sum-of-max → JOIN, max-of-sum → JOIN, add_group_by+reduce_by combo, etc.). New count_distinct / max measures + unique_customers_reduce_category / max_sum_reduce_category / total_by_customer_reduce_category in integration_multi_stage.yaml back the new cases. Contract is documented again. ✅
  • Medium — rolling snapshot non-deterministic: test_db_ts_rolling_with_dimension now orders by orders.category then orders.created_at; snapshot re-baselined accordingly. No longer relies on incidental row order. ✅
  • Low — dead commented filters: block: deleted, and the surrounding comment updated to describe the actual (no-filter) shape. ✅
  • Low — #[allow(dead_code)] stale: removed from with_sql_templates_and_timezone. ✅

Praise

  • The restored reduce_by tests are stronger than the originals: per-test comments now spell out the three grains (leaf / query / partition) and the exact expected per-status totals on the seed data, which makes future planner regressions much easier to triage.
  • Nice that the secondary order key was added at the query level rather than papering over it by sorting the snapshot — keeps the test honest about what the planner actually emits.

Not reviewed

  • Did not run cargo test locally.
· branch: `tesseract-additional-tests` ·

@waralexrom
waralexrom merged commit 8265a64 into master May 29, 2026
162 of 166 checks passed
@waralexrom
waralexrom deleted the tesseract-additional-tests branch May 29, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ Proxy