Skip to content

Conversation

@YoWuwuuuw
Copy link
Contributor

@YoWuwuuuw YoWuwuuuw commented Mar 11, 2025

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

  1. Organized the mariadb and mysql test classes, and moved them to the corresponding folder
  2. dm, kingbase, oracle, oscar test classes already exist and are located in 【org.apache.seata. rm.datasource.sql.druid】 , move them to the seata-sqlparser-druid module (Codecov test coverage is usually based on the module)
  3. Modify the postgresql test class (at 【org.apache.seata. rm.datasource.sql.druid】 ), the original generation method of the postgresql test class based on SQLVisitorFactory was changed to use the construction method, decoupled from the rm module and moved to the seata-sqlparser-druid module

Ⅱ. Does this pull request fix one issue?

fixes #7198

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

output:
image

This is a simple refactoring but now the coverage is not high, if we need to add the test code

@funky-eyes funky-eyes added first-time contributor first-time contributor module/sqlparser sql-parser module type: test test case labels Mar 11, 2025
@funky-eyes funky-eyes requested a review from Copilot March 11, 2025 09:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR refactors and reorganizes the unit tests for various SQL parser recognizers by moving them into the seata‑sqlparser‑druid module. It aligns the package structures for MySQL, MariaDB, Oracle, Kingbase, DM, and others, and updates the test classes to use the common AbstractRecognizerTest base class where applicable.

Reviewed Changes

File Description
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mysql/MySQLInsertRecognizerTest.java Updated package and import to align with vendor-specific subpackage and common test base
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/oracle/OracleInsertRecognizerTest.java Updated package to reflect new organizational structure
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mariadb/MariadbSelectForUpdateRecognizerTest.java Moved into dedicated mariadb package and adopted common test base import
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mariadb/MariadbUpdateRecognizerTest.java Moved into dedicated mariadb package and adopted common test base import
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/oracle/OracleDeleteRecognizerTest.java Package update to reflect removal from rm and relocation to sqlparser module
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/kingbase/KingbaseInsertRecognizerTest.java Updated package to dedicated kingbase package
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/oracle/OracleUpdateRecognizerTest.java Updated package to reflect new organizational structure
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/kingbase/KingbaseDeleteRecognizerTest.java Updated package to dedicated kingbase package
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mariadb/MariadbDeleteRecognizerTest.java Moved into dedicated mariadb package and updated imports to use common test base
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/kingbase/KingbaseSelectForUpdateRecognizerTest.java Updated package to dedicated kingbase package
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/kingbase/KingbaseUpdateRecognizerTest.java Updated package to dedicated kingbase package
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/dm/DmSelectForUpdateRecognizerTest.java Updated package and removed obsolete import
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/dm/DmInsertRecognizerTest.java Updated package reflecting reorganization of dm tests
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/dm/DmDeleteRecognizerTest.java Updated package and removed obsolete import
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mysql/MySQLUpdateRecognizerTest.java Updated package and import to use AbstractRecognizerTest instead of vendor recognizer
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/oracle/OracleSelectForUpdateRecognizerTest.java Updated package to reflect new organizational hierarchy
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/dm/DmUpdateRecognizerTest.java Updated package and removed obsolete import for DmUpdateRecognizer
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mysql/MySQLSelectForUpdateRecognizerTest.java Updated package and import using common test base for consistency
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mysql/MySQLDeleteRecognizerTest.java Updated package and adjusted imports to use AbstractRecognizerTest and BaseRecognizer
seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/mariadb/MariadbInsertRecognizerTest.java Moved into dedicated mariadb package and removed unused vendor-specific import

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

@codecov
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.29%. Comparing base (ca270a7) to head (53b267d).
Report is 1 commits behind head on 2.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #7203      +/-   ##
============================================
+ Coverage     51.67%   53.29%   +1.62%     
- Complexity     6841     7070     +229     
============================================
  Files          1169     1169              
  Lines         41585    41585              
  Branches       4871     4871              
============================================
+ Hits          21488    22162     +674     
+ Misses        18050    17327     -723     
- Partials       2047     2096      +49     

see 29 files with indirect coverage changes

🚀 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.

@funky-eyes funky-eyes added this to the 2.4.0 milestone Mar 12, 2025
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes
Copy link
Contributor

If you're using the DingTalk app, please send your DingTalk account to my email at [email protected], and I will invite you to join the Seata developer group

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

@slievrly slievrly changed the title add UT for DM/kingbase/oscar sqlparser test: add UT for DM/kingbase/oscar sqlparser Mar 12, 2025
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes funky-eyes merged commit 886874e into apache:2.x Mar 13, 2025
8 checks passed
slievrly pushed a commit to slievrly/fescar that referenced this pull request Oct 21, 2025
YvCeung pushed a commit to YvCeung/incubator-seata that referenced this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor first-time contributor module/sqlparser sql-parser module type: test test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add UT for DM/kingbase/oscar sqlparser

3 participants