Skip to content

Enhance code coverage - #2712

Merged
Divang Sharma (divang) merged 13 commits into
mainfrom
users/divang/code_coverage_enhancement
Nov 3, 2025
Merged

Enhance code coverage #2712
Divang Sharma (divang) merged 13 commits into
mainfrom
users/divang/code_coverage_enhancement

Conversation

@divang

Copy link
Copy Markdown
Contributor
  • Enhanced test cases for SQLServerConnectionTest and SQLServerDatabaseMetaData

…t classes (#2711)

* Enhanced test cases for  SQLServerConnectionTest and SQLServerDatabaseMetaData

Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
@codecov

codecov Bot commented Jul 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.27%. Comparing base (02e077c) to head (02a4803).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2712      +/-   ##
============================================
+ Coverage     52.26%   56.27%   +4.01%     
- Complexity     4152     4517     +365     
============================================
  Files           149      149              
  Lines         34378    34378              
  Branches       5734     5734              
============================================
+ Hits          17966    19347    +1381     
+ Misses        13918    12405    -1513     
- Partials       2494     2626     +132     

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

Divang Sharma (divang) and others added 4 commits July 22, 2025 12:59
* Improved the code coverage of SQLServerConnectionTest

* Fixed improved code coverage test cases

* Removed testValidateMaxSQLLoginName and testFederatedAuthentication_UserCase test cases. Those are failing in different env pipeline.

* Added logging.propertied in test resource and enhanced code coverage

* Improved more test coverage

* Fixed test cases

* Reverted logging.properties from test resource and enhanced more test cases

* Increased memory used by maven-surefire-plugin

* removed logging.properties file from test resources

* Enhanced test cases for SQLServerDatabaseMetaData

* Fixed bug

* Reverted the unnecessary changes

* Removed test cases which are breaking in different env

* Removed SecurityManager related test case, due to ADO pipeline failure

* Removed testValidateMaxSQLLoginName due to ADO pipeline failure

* Enhanced SQLServerBulkCopy code coverage

---------

Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
* Enhance test coverage for SQLServerCallableStatement

* fix junit failure for datetime data type

* Increased test coverage, and fixed junit failure

* refactored test case

* Fix JDK 8 incompatibility
* Enhance test coverage for SQLServerResultSet

* Updated tags on test
)

* JSON datatype support (#2558)

* JSON datatype implementation.

Co-authored-by: lilgreenbird <v-susanh@microsoft.com>
Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
Co-authored-by: Ananya Garg <anagarg@microsoft.com>
Co-authored-by: Muskan Gupta <muskgupta@microsoft.com>
Co-authored-by: Ananya Garg <ananya20.garg@gmail.com>

* Add new trusted AKV URLs for FR and DE (#2708)

* Add new trusted AKV URLs for FR and DE

* Update SQLServerColumnEncryptionAzureKeyVaultProvider.java

* Enhance code coverage for SQLServerConnectionPoolProxy

* Updated test to fix failures

---------

Co-authored-by: Divang Sharma <divang.s@gmail.com>
Co-authored-by: lilgreenbird <v-susanh@microsoft.com>
Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
Co-authored-by: Ananya Garg <anagarg@microsoft.com>
Co-authored-by: Ananya Garg <ananya20.garg@gmail.com>
Co-authored-by: Mahendra Chavan <machavan@microsoft.com>
* JSON datatype support (#2558)

* JSON datatype implementation.

Co-authored-by: lilgreenbird <v-susanh@microsoft.com>
Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
Co-authored-by: Ananya Garg <anagarg@microsoft.com>
Co-authored-by: Muskan Gupta <muskgupta@microsoft.com>
Co-authored-by: Ananya Garg <ananya20.garg@gmail.com>

* Add new trusted AKV URLs for FR and DE (#2708)

* Add new trusted AKV URLs for FR and DE

* Update SQLServerColumnEncryptionAzureKeyVaultProvider.java

* Updates for 13.1.1 preview release (#2715)

* Updates for 13.1.1 preview release

* Fixed PR link

* Removed unnecessary space

* Enhance test coverage for SQLServerSQLXML file.

---------

Co-authored-by: Divang Sharma <divang.s@gmail.com>
Co-authored-by: lilgreenbird <v-susanh@microsoft.com>
Co-authored-by: Divang Sharma <divangsharma@microsoft.com>
Co-authored-by: Muskan Gupta <muskgupta@microsoft.com>
Co-authored-by: Mahendra Chavan <machavan@microsoft.com>

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 PR enhances test coverage for SQLServerConnectionTest and SQLServerDatabaseMetaData by adding comprehensive JSON data type support and expanding test cases for various JDBC functionality.

Key Changes:

  • Added comprehensive JSON data type support with new test classes, enum values, and CSV test data
  • Enhanced PreparedStatement testing with extensive setter method coverage and batch execution scenarios
  • Expanded ResultSet testing to include getter/setter methods, stream operations, and JSON data handling
  • Added extensive DatabaseMetaData testing for capability methods, version information, and result set support

Reviewed Changes

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

Show a summary per file
File Description
BulkCopyCSVTestInputWithJson.csv Added CSV test data with JSON content for bulk copy operations
SqlTypeValue.java Added JSON enum value for SQL type testing framework
SqlType.java Enhanced with vendor type number support and constructor for JSON type
SqlJson.java New SQL JSON type class for test framework
Constants.java Added JSONTest tag for JSON-specific test categorization
RegressionTest.java Added comprehensive JSON query testing with CRUD operations
PreparedStatementTest.java Extensive testing of setter methods, batch operations, and edge cases
TVPTypesTest.java Added JSON support for Table-Valued Parameters
ResultSetTest.java Comprehensive getter/setter testing and JSON data handling
BatchExecutionWithBulkCopyTest.java Added JSON support for bulk copy operations
JSONFunctionTest.java New comprehensive test class for SQL Server JSON functions
DatabaseMetaDataTest.java Enhanced metadata testing with capability and version methods
Comments suppressed due to low confidence (6)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@machavan Mahendra Chavan (machavan) added this to the 13.3.0 milestone Aug 26, 2025
Comment thread CHANGELOG.md
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionTest.java Outdated
@divang

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

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

@divang

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

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

@divang

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/SQLServerBulkCopyTest.java Outdated
@divang
Divang Sharma (divang) merged commit 65e1929 into main Nov 3, 2025
19 checks passed
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.

5 participants