-
Notifications
You must be signed in to change notification settings - Fork 8.9k
test: add UT for DM/kingbase/oscar sqlparser #7203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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 🚀 New features to boost your workflow:
|
funky-eyes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
If you're using the DingTalk app, please send your DingTalk account to my email at |
funky-eyes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please register your PR in those two files :
https://github.com/apache/incubator-seata/blob/2.x/changes/zh-cn/2.x.md
https://github.com/apache/incubator-seata/blob/2.x/changes/en-us/2.x.md
slievrly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md
Ⅰ. Describe what this PR did
Ⅱ. 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:

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