Skip to content

Tests | Support multi-platform testing with exclusion tags and fix Skipping tests#1015

Merged
lilgreenbird merged 15 commits intomicrosoft:devfrom
cheenamalhotra:skippedTestsGoAway
Apr 9, 2019
Merged

Tests | Support multi-platform testing with exclusion tags and fix Skipping tests#1015
lilgreenbird merged 15 commits intomicrosoft:devfrom
cheenamalhotra:skippedTestsGoAway

Conversation

@cheenamalhotra
Copy link
Copy Markdown
Member

@cheenamalhotra cheenamalhotra commented Mar 29, 2019

This PR

  • Adds support to run JUnit tests with multiple SQL databases without skipping tests.
    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.
  • Adds plugin to perform jacoco:merge to generate cumulative code coverage for the source code.
  • Modifies tests to use Static connection instance from AbstractTest for operations that do not require special connection like creating/dropping objects. This connection is created either way with every test. Reduces execution time by 45 secs.
  • Removes unwanted Test Dependencies from POM.xml

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 29, 2019

Codecov Report

Merging #1015 into dev will increase coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@             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
Flag Coverage Δ Complexity Δ
#JDBC42 49.94% <ø> (+0.28%) 2862 <ø> (+25) ⬆️
#JDBC43 50.28% <ø> (+0.26%) 2895 <ø> (+18) ⬆️
Impacted Files Coverage Δ Complexity Δ
...om/microsoft/sqlserver/jdbc/SimpleInputStream.java 52.23% <0%> (-1.5%) 11% <0%> (-1%)
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 43.95% <0%> (-1.1%) 15% <0%> (ø)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 50.39% <0%> (-0.13%) 245% <0%> (-1%)
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 55.61% <0%> (+0.13%) 0% <0%> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 44.05% <0%> (+0.19%) 321% <0%> (+3%) ⬆️
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 68.53% <0%> (+0.29%) 0% <0%> (ø) ⬇️
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 47.3% <0%> (+1.07%) 112% <0%> (+2%) ⬆️
...m/microsoft/sqlserver/jdbc/SQLServerException.java 78.1% <0%> (+1.45%) 33% <0%> (+1%) ⬆️
...oft/sqlserver/jdbc/SQLServerResultSetMetaData.java 47.96% <0%> (+2.43%) 29% <0%> (+2%) ⬆️
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 65.83% <0%> (+4.92%) 153% <0%> (+16%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1a004e...1fe61b8. Read the comment docs.

@cheenamalhotra cheenamalhotra added this to the 7.3.1 milestone Mar 29, 2019
peterbae
peterbae previously approved these changes Apr 5, 2019
public static void terminateVariation() throws SQLException {
try (Connection connection = DriverManager.getConnection(connectionString);
Statement stmt = connection.createStatement()) {
try (Statement stmt = connection.createStatement()) {
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.

Why are we changing the tests to use connection from AbstractTest? Dropping tables will fail if that connection is broken.

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member Author

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.

@lilgreenbird lilgreenbird merged commit 9bc1faf into microsoft:dev Apr 9, 2019
@cheenamalhotra cheenamalhotra deleted the skippedTestsGoAway branch April 11, 2019 00:30
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.

6 participants