Skip to content

Add JUnit bug regression coverage for FX ResultSet and Statement execution - #2888

Merged
Ananya Garg (Ananya2) merged 10 commits into
mainfrom
user/anagarg/missing-fx-tests
Feb 23, 2026
Merged

Add JUnit bug regression coverage for FX ResultSet and Statement execution#2888
Ananya Garg (Ananya2) merged 10 commits into
mainfrom
user/anagarg/missing-fx-tests

Conversation

@Ananya2

@Ananya2 Ananya Garg (Ananya2) commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR migrates all FX bug regression tests related to ResultSet behavior and Statement / PreparedStatement / CallableStatement execution into JUnit, achieving 100% coverage with exact FX pattern fidelity.
The test suite now fully validates 24 execution/batching/cursor FX tests and 13 ResultSet-specific FX bugs, ensuring long-term regression safety and correctness.

What’s Covered

  1. Statement & Execution Bugs

These tests cover all execution paths across Statement, PreparedStatement, and CallableStatement, including cursor variations, close behavior, and holdability. They also validate batch execution, rollback handling, and connection stability, along with maxRows behavior across dynamic and static cursors. Timeout recovery, re-execution, error propagation, and SQLState validation are fully exercised.

  1. ResultSet Bugs

The ResultSet test coverage includes scrollable navigation edge cases, empty ResultSet behavior, and correct sequencing of insertRow() and updateRow() operations. It also validates long table name handling (127 characters), cursor downgrade and holdability bugs, stream refetch after partial consumption, CallableStatement ResultSet correctness, and proper exception propagation during cleanup.

Key Characteristics

  • Exact FX logic replication with similar iteration counts, fetchSize patterns, random operations, and execution order
  • Bug-accurate testing, validating actual historical bugs, not idealized behavior
  • Full coverage across variants with both autoCommit=true and autoCommit=false
  • All cursor and holdability combinations
  • Documented VSTS / SQL bug IDs

Result

All 37 FX bug regression scenarios are now validated via JUnit with no gaps found.

@codecov

codecov Bot commented Jan 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.77%. Comparing base (cf51d04) to head (151baab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2888      +/-   ##
============================================
+ Coverage     59.70%   60.77%   +1.07%     
- Complexity     4852     4917      +65     
============================================
  Files           151      151              
  Lines         34936    34936              
  Branches       5837     5837              
============================================
+ Hits          20860    21234     +374     
+ Misses        11301    10880     -421     
- Partials       2775     2822      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ananya2 Ananya Garg (Ananya2) changed the title Add JUnit bug regression coverage for FX ResultSet and Statement execution Migrate FX bug regression tests to JUnit with full ResultSet and Statement Execution coverage Jan 29, 2026
@Ananya2 Ananya Garg (Ananya2) changed the title Migrate FX bug regression tests to JUnit with full ResultSet and Statement Execution coverage Add JUnit bug regression coverage for FX ResultSet and Statement execution Jan 29, 2026
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request migrates bug regression tests from FX (legacy test framework) to JUnit for Statement and ResultSet functionality. The PR adds comprehensive test coverage for 37 historical bugs (24 in StatementTest, 13 in ResultSetTest) that were previously only validated in the FX test suite.

Changes:

  • Added nested BugRegressionTests class to StatementTest.java with 19 test methods covering Statement, PreparedStatement, and CallableStatement execution bugs
  • Added nested BugRegressionTests class to ResultSetTest.java with 13 test methods covering ResultSet navigation, updates, and cursor behavior bugs
  • Each test is tagged with corresponding bug IDs (VSTS, SQL Bug, Product Studio) for traceability

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
StatementTest.java Adds 1,240 lines of bug regression tests covering execution paths, batch operations, cursor variations, timeout handling, and SQL state validation for Statement/PreparedStatement/CallableStatement
ResultSetTest.java Adds 775 lines of bug regression tests covering scrollable navigation, insertRow/updateRow operations, cursor downgrades, holdability, and stream refetch scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
@Ananya2

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/resultset/ResultSetTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java Outdated
@Ananya2
Ananya Garg (Ananya2) merged commit a41b142 into main Feb 23, 2026
17 of 19 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Closed/Merged PRs in MSSQL JDBC Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed/Merged PRs

Development

Successfully merging this pull request may close these issues.

5 participants