Skip to content

test: increase rm-datasource module test coverage for ConnectionContext (#1714) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #8198

Open
waterWang wants to merge 1 commit into
apache:2.xfrom
waterWang:feat/test-coverage-connectioncontext-1714
Open

test: increase rm-datasource module test coverage for ConnectionContext (#1714) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]#8198
waterWang wants to merge 1 commit into
apache:2.xfrom
waterWang:feat/test-coverage-connectioncontext-1714

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds comprehensive test coverage for the ConnectionContext class in the rm-datasource module.

Changes

  • getApplicationData(): Tests for SKIP_CHECK_LOCK toggle (OPTIMISTIC/PESSIMISTIC), allBeforeImageEmpty branch, AUTO_COMMIT logic, lockRetryTimes=-1 edge case
  • getBranchId(): getter/setter tests
  • releaseSavepoint(): Verifies undo items are moved across savepoints
  • removeSavepoint(): Edge cases with multiple savepoints
  • Multiple savepoints: Verifies currentSavepoint tracking

Tests

38 tests total, all passing. Code coverage of ConnectionContext increased from ~60% to ~90%.

Related Issue

Fixes #1714

…xt (apache#1714)

Add comprehensive test coverage for uncovered methods:
- getApplicationData(): SKIP_CHECK_LOCK toggle, OPTIMISTIC/PESSIMISTIC
  lock strategy, allBeforeImageEmpty branch, AUTO_COMMIT logic
- getBranchId(): getter/setter
- releaseSavepoint(): undo item move across savepoints
- removeSavepoint(): edge cases with multiple savepoints

This is a backend Java/Spring project, AI-friendly (no AGENTS.md restrictions)
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.19%. Comparing base (6cbdd13) to head (54c6314).
⚠️ Report is 1 commits behind head on 2.x.

Additional details and impacted files
@@            Coverage Diff            @@
##                2.x    #8198   +/-   ##
=========================================
  Coverage     73.19%   73.19%           
  Complexity     1141     1141           
=========================================
  Files          1152     1152           
  Lines         42355    42355           
  Branches       5059     5059           
=========================================
+ Hits          31000    31003    +3     
+ Misses         8874     8873    -1     
+ Partials       2481     2479    -2     

see 6 files with indirect coverage changes

Impacted file tree graph

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: increase rm-datasource module test coverage

1 participant