Repository navigation
Update CLAUDE.md around tests and recurring bad habits - #114703
Conversation
Add three notes to `.claude/CLAUDE.md`: do not use try/catch to fall back to a less-optimized path, prefer functional tests over `gtest` unit tests, and throwaway CI-testing scripts do not need to be committed. Split out of #114675 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Carries over the suggestions applied in #114675 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The `.claude/CLAUDE.md` notes are split out into #114703 so that this pull request only removes `ci/tests`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [8f6c799] Summary: ✅ AI ReviewSummaryThis PR adds three contributor/agent-instruction notes to Findings
Final VerdictFix the CI-testing sentence so it matches the current repository and does not discourage checked-in regression tests for CI changes. |
|
|
||
| Prefer functional (.sql/.sh) tests over unit (gtest) tests whenever possible. Unit tests are larger, too specific, and they are difficult to maintain. | ||
|
|
||
| When you want to test changes in the CI scripts, you can write and run a throwaway test, but you don't need to commit it to the repository, because we don't have automated CI tests. |
There was a problem hiding this comment.
The new rule says CI-script throwaway tests never need to be committed because "we don't have automated CI tests", but the current tree still has a dedicated CI Tests job (ci/defs/job_configs.py:203, ci/defs/defs.py:431) and a checked-in ci/tests/ suite that the job runs via pytest ci/tests/ (ci/jobs/ci_tests_job.py:31-57).
That makes the statement false today, and it pushes contributors away from adding durable regression coverage for CI changes even though the infrastructure exists. I think this should be narrowed to one-off local probes, or explicitly say that reusable ci/tests/ regressions should still be committed.
There was a problem hiding this comment.
Maybe we have a few authentic tests, but I want to prevent dumping our "proof of work" there.
Master removed ci/tests/test_log_parser.py in ClickHouse#114675 ("Remove unit tests for CI scripts"), which produced a modify/delete conflict against the test file this branch extends. That pull request deleted 71 files under ci/tests and then restored 39 of them over the following two days, each restore commit naming the criterion: coverage that is the only focused guard for a still-live CI job or merge gate. test_log_parser.py was not among the restored files and was not raised in that pull request's review, so this merge honours the deletion instead of reinstating it, and the branch now changes only ci/jobs/scripts/log_parser.py. The parser change itself is unaffected: master has not touched log_parser.py since cf2cfec (2026-08-05), which this branch already merged, so the file is byte-identical to the previously reviewed version. The 18 assertions the deleted file carried were kept as a throwaway harness and run against the merged tree, per the guidance added in ClickHouse#114703 that CI script changes may be validated with a throwaway test rather than a committed one. All 18 pass, and each of the five behaviours this branch introduces was confirmed still pinned by reverting it in turn: stripping the captured query id, bypassing the anchored server pattern, applying it unconditionally, scanning for the format string with the unanchored pattern, and dropping the query id passed to get_failed_query. Every one reddens the corresponding assertion.
Adds three notes to
.claude/CLAUDE.md:.sql/.sh) tests over unit (gtest) tests whenever possible.Split out of #114675 so that the documentation change is reviewed separately from the removal of
ci/tests.Related: #114675
Changelog category (leave one):
Version info
26.8.1.1387(included in26.8and later)