Skip to content

Add 5 tests for coverage gaps in src/Client, src/Parsers, src/Storages - #129029

Merged
alexbakharew merged 3 commits into
ClickHouse:masterfrom
clickgapai:covgap/batch-20261102-151132
Nov 4, 2026
Merged

alexbakharew merged 3 commits into
ClickHouse:masterfrom
clickgapai:covgap/batch-20261102-151132

Conversation

@clickgapai

@clickgapai clickgapai commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Newly covered: +983 lines in 80 files (-145 lines lost coverage), reported by the CI job LLVM Coverage for commit f3e0857.

Expected from the agent's gates: 406 lines in the target files (169 of 180 target lines of the 5 functions), measured on the CI coverage build of each test's baseline commit, target file only.

Test-only PR from the coverage agent: 5 stateless tests, one per uncovered function, each verified by the agent's gates and released under its own content hash. The AI code review is the review of these tests; a test with an open review thread or a failing CI job is repaired in place or removed from this PR by the agent.

Test New lines Target lines hit Function File Target lines
05494_client_ai_sql_generation_paths 84 34 of 35 generateSQL src/Client/AI/AISQLGenerator.cpp 26-106
05495_part_moves_between_shards_step_retry 164 34 of 40 step src/Storages/MergeTree/PartMovesBetweenShardsOrchestrator.cpp 121-200
05496_client_login_oauth_discovery 67 34 of 38 ensureOAuthEndpointsResolved src/Client/JWTProvider.cpp 144-221
05493_pipe_operators_malformed_clauses 50 38 of 38 parseImpl src/Parsers/ParserPipeOperators.cpp 167-577
05497_logsql_unpack_json_options 41 29 of 29 parsePipeUnpack src/Parsers/LogsQL/LogsQLTextPipes.cpp 503-658

Add test for generateSQL in AISQLGenerator.cpp

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05494_client_ai_sql_generation_paths, which executes code that no stateless test on master executes: generateSQL in src/Client/AI/AISQLGenerator.cpp, lines 26-106 (source at db92feff771a). The function had 35 executable lines with 0 hits in the 4 LLVM coverage baselines of master (db92fef, d1032a1, 44cf9c0, 8b3e78c).

Why this test is needed: This test is needed because generateSQL is a SQL-reachable candidate that drives AI SQL generation, tool-display callbacks and the success-versus-empty result path, and those lines are still uncovered.
What the test asserts: The test asserts a user-visible result by sending a fixed prompt through the SQL generation path and checking that the returned query text is the cleaned SQL string extracted from the model response.

Measured on the CI coverage build of db92feff771a. A line counts as uncovered only when it has 0 hits in all 4 baselines.

Check Result
Plain run on the release binary OK in 0.96 s on the plain binary
Coverage effect 34/35 target lines hit; expected missed []; new lines in file 84
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 0.98, 'wall_s': 20.41}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail'
Style check style check ok in 22 s
Duplicate statements in tests/queries/0_stateless 3 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash c4839c4d2011. It was renumbered from 05446_client_ai_sql_generation_paths at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Add test for step in PartMovesBetweenShardsOrchestrator.cpp

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05495_part_moves_between_shards_step_retry, which executes code that no stateless test on master executes: step in src/Storages/MergeTree/PartMovesBetweenShardsOrchestrator.cpp, lines 121-200 (source at a3c1418967fb). The function had 40 executable lines with 0 hits in the 4 LLVM coverage baselines of master (a3c1418, bc84324, 8e3eb7a, 39d97ae).

Why this test is needed: This test is needed because this SQL-reachable candidate still misses the leader-side step setup that acquires ZooKeeper and selects the next pending move entry to process.
What the test asserts: It asserts that a SQL workflow which triggers a part move on the leader enters the orchestration path instead of returning early, so execution reaches lines 122, 125 and 127.

Measured on the CI coverage build of a3c1418967fb. A line counts as uncovered only when it has 0 hits in all 4 baselines.

Check Result
Plain run on the release binary OK in 3.94 s on the plain binary
Coverage effect 34/40 target lines hit; expected missed []; new lines in file 164
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 4.15, 'wall_s': 81.73}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail'
Style check style check ok in 23 s
Duplicate statements in tests/queries/0_stateless 14 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash b2bebaab3681. It was renumbered from 05452_part_moves_between_shards_step_retry at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Add test for ensureOAuthEndpointsResolved in JWTProvider.cpp

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05496_client_login_oauth_discovery, which executes code that no stateless test on master executes: ensureOAuthEndpointsResolved in src/Client/JWTProvider.cpp, lines 144-221 (source at 54d0c85e4b63). The function had 38 executable lines with 0 hits in the 4 LLVM coverage baselines of master (54d0c85, 67e3c22, 1df150b, 808fe40).

Why this test is needed: This test is needed because the SQL-reachable OAuth login path in ensureOAuthEndpointsResolved still lacks coverage for endpoint override handling, discovery fallbacks, and BAD_ARGUMENTS failures.
What the test asserts: It asserts that login either resolves explicit or discovered OAuth endpoints correctly or fails with the documented BAD_ARGUMENTS message when required inputs are missing or discovery data is invalid.

Measured on the CI coverage build of 54d0c85e4b63. A line counts as uncovered only when it has 0 hits in all 4 baselines. Line 146 is exempt from the expected lines: line 146 requires a second getJWT after a server-accepted connection, which a stateless test cannot reach here because the test server has no jwt_validators; lines 165-167 sit behind the createJwtProvider guard, so when line 163 is reached oauth_url is already non-empty and that branch cannot fire Line 165 is exempt from the expected lines: line 146 requires a second getJWT after a server-accepted connection, which a stateless test cannot reach here because the test server has no jwt_validators; lines 165-167 sit behind the createJwtProvider guard, so when line 163 is reached oauth_url is already non-empty and that branch cannot fire

Check Result
Plain run on the release binary OK in 0.23 s on the plain binary
Coverage effect 34/38 target lines hit; expected missed []; new lines in file 67
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 0.3, 'wall_s': 6.46}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail':
Style check style check ok in 69 s
Duplicate statements in tests/queries/0_stateless 2 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash 1415c4cab3b2. It was renumbered from 05483_client_login_oauth_discovery at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Add test for parseImpl in ParserPipeOperators.cpp

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05493_pipe_operators_malformed_clauses, which executes code that no stateless test on master executes: parseImpl in src/Parsers/ParserPipeOperators.cpp, lines 167-577 (source at 1df150bae26c). The function had 38 executable lines with 0 hits in the 4 LLVM coverage baselines of master (1df150b, 9dfe51c, 808fe40, c189bd9).

Why this test is needed: This test is needed because parseImpl has a SQL-reachable candidate path for pipe operators where SELECT, EXTEND, and SET clauses reject malformed lists or replacements during parser rewrites.
What the test asserts: The test asserts that pipe syntax with malformed SELECT, EXTEND, or SET input is parsed into the expected user-visible syntax error or accepted rewrite result for those branches.

Measured on the CI coverage build of 1df150bae26c. A line counts as uncovered only when it has 0 hits in all 4 baselines.

Check Result
Plain run on the release binary OK in 0.14 s on the plain binary
Coverage effect 38/38 target lines hit; expected missed []; new lines in file 50
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 0.13, 'wall_s': 3.34}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail':
Style check style check ok in 68 s
Duplicate statements in tests/queries/0_stateless 25 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash e44688d05cbc. It was renumbered from 05480_pipe_operators_malformed_clauses at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Add test for parsePipeUnpack in LogsQLTextPipes.cpp

Test-only PR from the coverage agent. Review: is the gap real, is the test right.

Adds tests/queries/0_stateless/05497_logsql_unpack_json_options, which executes code that no stateless test on master executes: parsePipeUnpack in src/Parsers/LogsQL/LogsQLTextPipes.cpp, lines 503-658 (source at e6c0a8e34e89). The function had 29 executable lines with 0 hits in the 4 LLVM coverage baselines of master (e6c0a8e, f832936, 54d0c85, 1df150b).

Why this test is needed: This parser path handles optional source selection, field lists, preserve_keys, result_prefix, and fallback behavior for LogsQL unpack pipes, and the selected target lines cover SQL-reachable branches that are still uncovered.
What the test asserts: The test should assert that unpack_json with explicit fields and preserve_keys returns the expected extracted and preserved values through the user-visible query result.

Measured on the CI coverage build of e6c0a8e34e89. A line counts as uncovered only when it has 0 hits in all 4 baselines.

Check Result
Plain run on the release binary OK in 0.1 s on the plain binary
Coverage effect 29/29 target lines hit; expected missed []; new lines in file 41
Reruns, random and pinned settings {'reruns': {'random': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail': 0, 'slowest_s': 0.12, 'wall_s': 3.02}, 'pinned': {'rc': 0, 'runs_seen': 20, 'ok': 20, 'fail':
Style check style check ok in 67 s
Duplicate statements in tests/queries/0_stateless 14 statements, no duplicate

The test was written by an AI agent (a Nerve worker on Claude) from a task of a deterministic census, verified by the gates above, and released under content hash 5f14d19f5976. It was renumbered from 05493_logsql_unpack_json_options at publication. The PR is a draft until a person has reviewed it. Replies to review comments come from the agent's owner, not from the agent.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Version info

  • Merged into: 26.11.1.1311-master (included in 26.11 and later)

…orages`

- `05493_pipe_operators_malformed_clauses` for `parseImpl` in `src/Parsers/ParserPipeOperators.cpp`, release hash e44688d05cbc
- `05494_client_ai_sql_generation_paths` for `generateSQL` in `src/Client/AI/AISQLGenerator.cpp`, release hash 6b52668dc44f
- `05495_part_moves_between_shards_step_retry` for `step` in `src/Storages/MergeTree/PartMovesBetweenShardsOrchestrator.cpp`, release hash b2bebaab3681
- `05496_client_login_oauth_discovery` for `ensureOAuthEndpointsResolved` in `src/Client/JWTProvider.cpp`, release hash 1415c4cab3b2
- `05497_logsql_unpack_json_options` for `parsePipeUnpack` in `src/Parsers/LogsQL/LogsQLTextPipes.cpp`, release hash 5f14d19f5976

Written by the coverage agent, verified against the master coverage baselines.
@clickhouse-gh clickhouse-gh Bot added the can be tested Allows running workflows for external contributors label Nov 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f3e0857]

Summary: ✅


AI Review

Summary

PR #129029 adds five stateless tests covering malformed pipe clauses, interactive AI SQL generation, shard-move failure accounting, OAuth endpoint discovery, and LogsQL unpack_json options. No actionable findings in the current diff at f3e0857310c187f85fd38e7698293f171067cf8a.

Missing context / blind spots
  • ⚠️ No ClickHouse binary or build is available in this workspace, so the tests and reported coverage gains were not independently reproduced. The available Praktika reports contain no runtime results for these tests. Completed stateless and LLVM coverage results would close this validation gap; the PR description provides baseline coverage measurements and repeated release-binary runs.
Final Verdict

Status: ✅ Approve. No inline findings to post.

LLVM Coverage Report

Measured on commit f3e0857.

Metric Baseline Current Δ
Lines 88.90% 89.00% +0.10%
Functions 91.50% 91.50% +0.00%
Branches 80.60% 80.70% +0.10%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +983 lines in 80 files (-145 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog ci-llvm-coverage labels Nov 3, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 3, 2026
@clickgapai clickgapai changed the title Add 5 tests for coverage gaps in src/Client, src/Parsers, src/Storages Add 5 tests for coverage gaps in src/Client, src/Parsers, src/Storages (+406 covered lines) Nov 3, 2026
@clickgapai clickgapai changed the title Add 5 tests for coverage gaps in src/Client, src/Parsers, src/Storages (+406 covered lines) Add 5 tests for coverage gaps in src/Client, src/Parsers, src/Storages Nov 3, 2026
Repair round of the coverage agent for PR ClickHouse#129029: the fixes of all open review threads in one commit. Verified again against the master coverage baselines; release hash c43c55ee5ee3.
Repair round of the coverage agent for PR ClickHouse#129029: the fixes of all open review threads in one commit. Verified again against the master coverage baselines; release hash c4839c4d2011.
@clickgapai
clickgapai marked this pull request as ready for review November 3, 2026 21:03
@alexbakharew
alexbakharew added this pull request to the merge queue Nov 4, 2026
Merged via the queue into ClickHouse:master with commit 30356f9 Nov 4, 2026
185 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors ci-llvm-coverage comp-testing Test content only (no production code). pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants