You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "slievrly (via GitHub)" <gi...@apache.org> on 2026/10/07 12:43:21 UTC

[PR] test: improve console and druid module unit coverage [incubator-seata]

slievrly opened a new pull request, #8300:
URL: https://github.com/apache/incubator-seata/pull/8300

   - [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
   - [ ] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ### Ⅰ. Describe what this PR did
   
   Add 153 unit test cases across 20 new test classes to improve standalone coverage of console and sqlparser-druid.
   
   - Console: verify MCP transaction/lock tools, confirmation checks, query time bounds, DTO/response conversion, remote HTTP failures, JWT authentication and filter behavior, and MCP configuration.
   - Druid: verify dialect-specific insert/update/delete/select recognizers, batch parameter ordering and SQL NULL conversion, qualified columns, unsupported ASTs, nested MySQL joins, Oracle multi-insert, and recognizer factory dispatch.
   - Exclude the embedded `target/classes/lib/sqlparser/druid.jar` from Druid's JaCoCo reports. This dependency was being scanned as application bytecode. All Seata production classes remain included; test instrumentation and runtime packaging are unchanged.
   
   ### Ⅱ. Does this pull request fix one issue?
   
   Refs #6122.
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)?
   
   Added 53 console cases and 100 Druid cases. HTTP interactions use MockRestServiceServer or mocks; no external services are required.
   
   ### Ⅳ. Describe how to verify it
   
   Tested only these two modules on JDK 25, using the local Maven dependency cache. Removed their JaCoCo execution data before the final run; no whole-project tests or CI were run locally.
   
   ```sh
   mvn -B -pl console,sqlparser/seata-sqlparser-druid test \
     -Dskip.installnodenpm=true -Dskip.npm=true \
     '-DspotlessFiles=.*BehaviorTest.java' \
     -Dcheckstyle.skip=false '-Dcheckstyle.includes=**/*BehaviorTest.java'
   ```
   
   | Module | Baseline JaCoCo lines | Final JaCoCo lines | Fully covered lines / total | Tests |
   | --- | ---: | ---: | ---: | --- |
   | console | 13.72% | 91.52% (734/802) | 91.02% (730/802) | 57 passed |
   | sqlparser-druid | 77.45% | 93.96% (2100/2235) | 90.34% (2019/2235) | 435 passed, 1 existing conditional skip |
   
   Baseline and final Druid percentages both use the same 2,235 lines of Seata source, excluding third-party Druid bytecode. The report scope correction is not counted as a UT coverage improvement. Spotless and Checkstyle passed for all added tests.
   
   ### Ⅴ. Special notes for reviews
   
   Based on upstream `2.x` at `e33b61c93`. Console compiles with release 17; Druid retains source/target 8. The fully covered line column treats any executed line with missed branches as partial and is a local Codecov-style estimate, not an uploaded Codecov result. Repository-wide coverage can differ because of cross-module test execution and Codecov source mapping.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] test: improve console and druid module unit coverage [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8300:
URL: https://github.com/apache/incubator-seata/pull/8300#issuecomment-6040158317

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8300?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 79.89%. Comparing base ([`8436907`](https://app.codecov.io/gh/apache/incubator-seata/commit/84369072f049be4c531c4d80a227d1a328e4aa49?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d53adc9`](https://app.codecov.io/gh/apache/incubator-seata/commit/d53adc968498342c66d0073a283e5f0a398c5af9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##                2.x    #8300      +/-   ##
   ============================================
   + Coverage     78.06%   79.89%   +1.83%     
   + Complexity     1166     1165       -1     
   ============================================
     Files          1400     1400              
     Lines         52977    52977              
     Branches       6344     6344              
   ============================================
   + Hits          41354    42328     +974     
   + Misses         8605     7699     -906     
   + Partials       3018     2950      -68     
   ```
   [see 87 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8300/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/8300/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/8300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] test: improve console and druid module unit coverage [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #8300:
URL: https://github.com/apache/incubator-seata/pull/8300


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org