-
Notifications
You must be signed in to change notification settings - Fork 427
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
Tests | Support multi-platform testing with exclusion tags and fix Skipping tests #1015
Tests | Support multi-platform testing with exclusion tags and fix Skipping tests #1015
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1015 +/- ##
============================================
+ Coverage 50.09% 50.36% +0.26%
- Complexity 2878 2900 +22
============================================
Files 120 120
Lines 27989 27989
Branches 4677 4677
============================================
+ Hits 14022 14096 +74
+ Misses 11713 11633 -80
- Partials 2254 2260 +6
Continue to review full report at Codecov.
|
5a0fec0
to
58a53c8
Compare
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/BatchExecuteWithErrorsTest.java
Show resolved
Hide resolved
String sql1 = "create table " + tableName + " (c1 float, c2 real)"; | ||
stmt.execute(sql1); | ||
} | ||
} | ||
|
||
@AfterAll | ||
public static void terminateVariation() throws SQLException { | ||
try (Connection connection = DriverManager.getConnection(connectionString); | ||
Statement stmt = connection.createStatement()) { | ||
try (Statement stmt = connection.createStatement()) { |
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.
Why are we changing the tests to use connection
from AbstractTest
? Dropping tables will fail if that connection is broken.
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.
This Static Connection is recreated everytime with every test class. This is an attempt to reduce number of connections specially when running tests with Azure databases.
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.
As also mentioned in PR description, this change reduces time of Junit execution by 45 secs in normal run (against SQL 2019) and much more on Azure databases.
This PR
Tagging tests for exclusions safely excludes test classes/tests from being tested against targeted SQL Server. Exclusion tags are based on non-compatibility of tests against respective SQL Servers.
jacoco:merge
to generate cumulative code coverage for the source code.connection
instance fromAbstractTest
for operations that do not require special connection like creating/dropping objects. Thisconnection
is created either way with every test. Reduces execution time by 45 secs.