Skip to content

tests: remove get_format integration checks#4668

Merged
ti-chi-bot[bot] merged 2 commits intopingcap:masterfrom
tenfyzhong:tests/remove-get-format-cases-4667
Apr 1, 2026
Merged

tests: remove get_format integration checks#4668
ti-chi-bot[bot] merged 2 commits intopingcap:masterfrom
tenfyzhong:tests/remove-get-format-cases-4667

Conversation

@tenfyzhong
Copy link
Copy Markdown
Collaborator

@tenfyzhong tenfyzhong commented Apr 1, 2026

What problem does this PR solve?

Issue Number: close #4667

What is changed and how it works?

This PR removes the get_format assertions from date_formats integration test case.
Those checks are not stable across environments and are not required for validating
str_to_date behavior in this case.

Check List

Tests

  • Integration test

Questions

Will it cause performance regression or break compatibility?

No.

Do you need to update user documentation, design documentation or monitoring documentation?

No.

Release note

None

Summary by CodeRabbit

  • Tests
    • Streamlined date/time format tests by removing several GET_FORMAT-based checks and a legacy charset-specific test section.
    • Adjusted expectations so a specific str_to_date check now expects NULL where previous parsed values were asserted.

@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a81bc617-359a-41fa-ba87-5774cd61ab21

📥 Commits

Reviewing files that changed from the base of the PR and between 6eaf20e and 8d8e443.

📒 Files selected for processing (2)
  • tests/integration_tests/tidb_mysql_test/r/date_formats.result
  • tests/integration_tests/tidb_mysql_test/t/date_formats.test
💤 Files with no reviewable changes (2)
  • tests/integration_tests/tidb_mysql_test/t/date_formats.test
  • tests/integration_tests/tidb_mysql_test/r/date_formats.result

📝 Walkthrough

Walkthrough

Removed TiDB get_format()-related test assertions and expected output rows from the TiCDC test files; retained only the str_to_date(..., GET_FORMAT(DATE,'USA')) case (now expecting NULL) and removed the Bug#58005 character-set checks.

Changes

Cohort / File(s) Summary
Date format tests
tests/integration_tests/tidb_mysql_test/t/date_formats.test, tests/integration_tests/tidb_mysql_test/r/date_formats.result
Removed multiple GET_FORMAT() query assertions and their expected result rows (DATE/TIME/DATETIME/TIMESTAMP and GET_FORMAT(DATE,'TEST')). Dropped the Bug#58005 section that changed client charset and used LEAST(..., GET_FORMAT(datetime,'eur'), ...). Left only the str_to_date(..., GET_FORMAT(DATE,'USA')) assertion, which now expects NULL. Minor whitespace/format normalization in test output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

lgtm, size/XS

Suggested reviewers

  • lidezhu
  • wk989898
  • wlwilliamx

Poem

🐰 Hop, hop, the old GET_FORMATs are through,

I kept the one that TiCDC uses true;
Tests trimmed light, no extra ties to bind,
A cleaner suit, with fewer things to find.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'tests: remove get_format integration checks' clearly and specifically describes the main change: removing get_format-related integration test assertions.
Description check ✅ Passed The PR description includes all required template sections: issue number (close #4667), explanation of changes, test type (integration test), answers to compatibility questions, and release note (None).
Linked Issues check ✅ Passed The PR fully addresses the objective in issue #4667 by removing get_format test coverage from date_formats test files, eliminating unnecessary TiCDC test dependencies on TiDB's select behavior.
Out of Scope Changes check ✅ Passed All changes are limited to removing get_format assertions from integration test files, with no unrelated or out-of-scope modifications to production code or other test concerns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 1, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes several get_format test cases and their corresponding results from the integration tests to improve environmental stability. It also includes minor whitespace cleanups in the test files. A review comment suggests replacing a remaining GET_FORMAT call inside str_to_date with a literal format string to ensure the test remains fully independent of environment-specific date formats.

select get_format(DATETIME, 'eur') as a;
select get_format(TIMESTAMP, 'eur') as a;
select get_format(DATE, 'TEST') as a;
select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The PR aims to remove get_format assertions because they are unstable across environments. However, this line still uses GET_FORMAT(DATE, 'USA') as an argument to str_to_date. If the output of GET_FORMAT changes, the result of this query (currently NULL) might also change, leading to continued instability. To fully achieve the goal of environment-independent tests, consider replacing GET_FORMAT(DATE, 'USA') with a literal format string like '%m.%d.%Y'.

select str_to_date('15-01-2001 12:59:59', '%m.%d.%Y');

@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/test pull-cdc-mysql-integration-heavy-next-gen

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 1, 2026
- Remove test cases for GET_FORMAT function from date_formats test
- Update expected results to reflect removal of these test cases
- The function appears to no longer be supported or tested

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
- Removed failing test case for Bug#58005 from both test and result files
- The test involved utf8 charset with GET_FORMAT function causing assertion failure
- This cleanup eliminates test failures while maintaining other test coverage

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
@tenfyzhong tenfyzhong force-pushed the tests/remove-get-format-cases-4667 branch from 6eaf20e to 8d8e443 Compare April 1, 2026 08:12
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 1, 2026
@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/test all

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lidezhu, wk989898

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 1, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 1, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-01 07:47:12.714161999 +0000 UTC m=+337637.919522046: ☑️ agreed by wk989898.
  • 2026-04-01 08:22:33.398644035 +0000 UTC m=+339758.604004092: ☑️ agreed by lidezhu.

@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/retest

1 similar comment
@tenfyzhong
Copy link
Copy Markdown
Collaborator Author

/retest

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 1, 2026

@tenfyzhong: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cdc-mysql-integration-heavy-next-gen 6eaf20e link false /test pull-cdc-mysql-integration-heavy-next-gen
pull-cdc-mysql-integration-light-next-gen 8d8e443 link unknown /test pull-cdc-mysql-integration-light-next-gen

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 1858556 into pingcap:master Apr 1, 2026
29 of 31 checks passed
tenfyzhong added a commit that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: Remove TiDB select tests that depend on get_format

3 participants