Skip to content

chore: Add failing tests reproducing old bugs (#5652, #6158, #8561, #10181, #10962, #11240) - #12557

Open
paveltiunov wants to merge 1 commit into
masterfrom
pavel-claude/brave-archimedes-1ifhwk
Open

paveltiunov wants to merge 1 commit into
masterfrom
pavel-claude/brave-archimedes-1ifhwk

Conversation

@paveltiunov

Copy link
Copy Markdown
Member

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

Refs #5652, #6158, #8561, #10181, #10962, #11240. These tests only reproduce the bugs and don't fix them. Each one fails on current master. I also reproduced every bug end to end on the v1.8.16 release, running Cube and Cube Store against Postgres 16.

Test runs:

  • TEST_LOCAL=1 jest dist/test/integration/postgres/issue-* with CUBEJS_TESSERACT_SQL_PLANNER=true and false: all fail as described above.
  • jest dist/test/graphql.test.js: only the new time measures test fails.
  • cargo test -p cubesql --lib test_bind_after_failed_parse_is_skipped: fails with 2EZ instead of EZ.

Generated by Claude Code

…10181, #10962, #11240)

These tests only reproduce the bugs and don't fix them:

- #8561 schema-compiler: subquery dimension join aliases ignore sql_alias,
  so long cube names collide after Postgres truncates identifiers
- #10181 schema-compiler: ungrouped query on a cube without a primary key
  fails in PreAggregations even with allowUngroupedWithoutPrimaryKey
- #6158 schema-compiler: case dimension with an empty when list renders
  invalid SQL
- #11240 schema-compiler: time_shift measure with a joined cube dimension
  splits each day into two rows
- #5652 api-gateway: time measures always resolve to null in GraphQL
- #10962 cubesql: Bind after a failed Parse still sends BindComplete

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgekqD53E1skuvTgq3W1Ks
@claude

claude Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @paveltiunov's task in 1m 35s —— View job


Changes requested: 1 high, 1 medium, 2 low. All six new tests fail on master and run in CI, so merging this as-is turns CI red.

Review details
  • Read diff and changed files
  • Check tests against referenced issues and CI wiring
  • Review threads
  • Post findings

Findings

Severity Where Issue
High packages/cubejs-api-gateway/test/graphql.test.ts:478 (also issue-6158, issue-8561, issue-10181, issue-11240) The tests fail on master and CI runs them: the api-gateway unit step, and integration:postgres on both planners. Use test.failing (the repo already does this in cubejs-testing/test/smoke-view-join.test.ts:75).
Medium rust/cubesql/cubesql/src/compile/test/test_extended_query_errors.rs:109 cargo insta test --workspace (rust-cubesql.yml:113) runs this test and it fails. Add #[ignore = "…/issues/10962"]. #[should_panic] is a worse fit because it would also pass on a timeout or a handshake failure.
Low issue-11240.test.ts:1-5 and the other file headers Header comments run past 3 lines and re-narrate the issue. Keep the load-bearing sentence.
Low issue-10181.test.ts:34 The as any is unnecessary, since allowUngroupedWithoutPrimaryKey is in BaseQueryOptions.

Notes

})(req, res);
});

test('should return the value of a time measure', async () => {

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.

High: merging this turns CI red. Every new test fails on master, and CI runs all of them:

  • this one: the api-gateway unit step (push.yml:139, lerna run unit)
  • issue-{6158,8561,10181,11240}.test.ts: the integration job, postgres matrix entry (.github/actions/integration/postgres.sh → integration:postgres), on both use_tesseract_sql_planner values
  • test_bind_after_failed_parse_is_skipped: cargo insta test --workspace in rust-cubesql.yml:113

The repo already has a pattern for this: packages/cubejs-testing/test/smoke-view-join.test.ts:75 uses test.failing(...). Jest 29 supports it here. It also signals when a fix lands, because the test then "unexpectedly passes" and has to be flipped back to test. In Rust, see the comment on test_extended_query_errors.rs:109.

Suggested change
test('should return the value of a time measure', async () => {
test.failing('should return the value of a time measure', async () => {

The same change applies to the it(...) in issue-6158, issue-8561 and issue-10181, and to testIfNative in issue-11240 (getEnv('nativeSqlPlanner') ? it.failing : it.skip). One caveat: test.failing passes on any throw, so a broken DB connection or a typo in the fixture also counts as "still failing". Pinning the expected error, as smoke-view-join.test.ts:119 does, keeps the test honest.

socket
}

#[tokio::test]

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 test fails on master (2EZ vs EZ), and rust-cubesql.yml:113 runs cargo insta test --workspace, so the cubesql job goes red once this merges. Mark it ignored until #10962 is fixed. #[should_panic] is a worse fit: it would also pass on the 10s read timeout or on any expect in the handshake.

Suggested change
#[tokio::test]
#[tokio::test]
#[ignore = "https://github.com/cube-js/cube/issues/10962"]

Comment on lines +1 to +5
// Reproduces https://github.com/cube-js/cube/issues/11240: a `time_shift` measure
// queried with a dimension of a joined cube. The shifted CTE joins that cube on the
// unshifted fact date, so its `day_name` belongs to the previous day, and the final
// join uses `day_name` to align the shifted and current rows. Each day comes back as
// two rows, one with `total` and one with `total_prior_day`.

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.

Low: this 5-line header re-narrates the issue. The same goes for the headers in issue-8561.test.ts:1-5, issue-10181.test.ts:1-5, test_extended_query_errors.rs:1-5 and the 3–4 line blocks in issue-6158.test.ts and graphql.test.ts:422. The issue link and the test name already carry the symptom. Keep the load-bearing sentence, i.e. what a later reader would get wrong without it. Here that is:

Suggested change
// Reproduces https://github.com/cube-js/cube/issues/11240: a `time_shift` measure
// queried with a dimension of a joined cube. The shifted CTE joins that cube on the
// unshifted fact date, so its `day_name` belongs to the previous day, and the final
// join uses `day_name` to align the shifted and current rows. Each day comes back as
// two rows, one with `total` and one with `total_prior_day`.
// https://github.com/cube-js/cube/issues/11240: the shifted CTE joins dim_date on the
// unshifted date, so aligning on day_name splits each day into two rows.

allowUngroupedWithoutPrimaryKey: true,
order: [{ id: 'no_pk.a' }],
timezone: 'UTC',
} as any);

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.

Low: the as any isn't needed. allowUngroupedWithoutPrimaryKey is declared in BaseQueryOptions (src/adapter/BaseQuery.ts:128), and order is any[]. The cast only hides type errors if the option is renamed.

Suggested change
} as any);
});

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants