Skip to content

Commit 81d6f16

Browse files
committed
chore(bq jdbc): Add integration test suites
1 parent 60d6def commit 81d6f16

10 files changed

Lines changed: 691 additions & 372 deletions

File tree

java-bigquery/.cloudbuild/scripts/jdbc-nightly.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ source .kokoro/common.sh
55
install_modules java-bigquery
66

77
cd ${ROOT_FOLDER}/java-bigquery/google-cloud-bigquery-jdbc
8-
make integration-test test=ITBigQueryJDBCTest
9-
make integration-test test=ITNightlyBigQueryTest
8+
make integration-test test=ITNightlyTests

java-bigquery/.cloudbuild/scripts/jdbc-presubmit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ source .kokoro/common.sh
55
install_modules java-bigquery
66

77
cd ${ROOT_FOLDER}/java-bigquery/google-cloud-bigquery-jdbc
8-
make integration-test test=ITBigQueryJDBCTest
8+
make integration-test test=ITPresubmitTests
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.google.cloud</groupId>
7+
<artifactId>google-cloud-bigquery-jdbc-it-standalone</artifactId>
8+
<!-- Use same version as the main project, or generic 1.0-SNAPSHOT -->
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
<name>BigQuery JDBC Standalone IT Tests</name>
12+
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.compiler.source>8</maven.compiler.source>
16+
<maven.compiler.target>8</maven.compiler.target>
17+
</properties>
18+
19+
<dependencies>
20+
<!-- Include the test classes from the main project -->
21+
<dependency>
22+
<groupId>com.google.cloud</groupId>
23+
<artifactId>google-cloud-bigquery-jdbc</artifactId>
24+
<version>0.4.1-SNAPSHOT</version>
25+
<type>test-jar</type>
26+
<scope>compile</scope>
27+
</dependency>
28+
29+
<!-- Console launcher to run tests from command line without maven -->
30+
<dependency>
31+
<groupId>org.junit.platform</groupId>
32+
<artifactId>junit-platform-console-standalone</artifactId>
33+
<version>1.11.4</version>
34+
<scope>compile</scope>
35+
</dependency>
36+
37+
<!-- Test dependencies are usually test scope, we make them compile here so they get shaded into the jar -->
38+
<dependency>
39+
<groupId>com.google.truth</groupId>
40+
<artifactId>truth</artifactId>
41+
<version>1.4.4</version>
42+
<scope>compile</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.junit.jupiter</groupId>
46+
<artifactId>junit-jupiter-api</artifactId>
47+
<version>5.11.4</version>
48+
<scope>compile</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter-engine</artifactId>
53+
<version>5.11.4</version>
54+
<scope>compile</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.junit.jupiter</groupId>
58+
<artifactId>junit-jupiter-params</artifactId>
59+
<version>5.11.4</version>
60+
<scope>compile</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.mockito</groupId>
64+
<artifactId>mockito-core</artifactId>
65+
<version>4.11.0</version>
66+
<scope>compile</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.mockito</groupId>
70+
<artifactId>mockito-junit-jupiter</artifactId>
71+
<version>4.11.0</version>
72+
<scope>compile</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.junit.platform</groupId>
76+
<artifactId>junit-platform-suite-api</artifactId>
77+
<version>1.11.4</version>
78+
<scope>compile</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.junit.platform</groupId>
82+
<artifactId>junit-platform-suite-engine</artifactId>
83+
<version>1.11.4</version>
84+
<scope>compile</scope>
85+
</dependency>
86+
</dependencies>
87+
88+
<build>
89+
<plugins>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-shade-plugin</artifactId>
93+
<version>3.5.2</version>
94+
<executions>
95+
<execution>
96+
<phase>package</phase>
97+
<goals>
98+
<goal>shade</goal>
99+
</goals>
100+
<configuration>
101+
<!--
102+
We exclude the main bigquery-jdbc framework classes.
103+
This jar should ONLY contain tests and their dependencies (Junit, Mockito, Truth),
104+
plus the test classes themselves. When running, the ACTUAL JDBC driver jar
105+
will be placed on the classpath.
106+
-->
107+
<artifactSet>
108+
<excludes>
109+
<exclude>com.google.cloud:google-cloud-bigquery-jdbc:jar</exclude>
110+
<exclude>com.google.cloud:google-cloud-bigquery</exclude>
111+
<exclude>com.google.cloud:google-cloud-bigquerystorage</exclude>
112+
<exclude>io.grpc:*</exclude>
113+
<exclude>com.google.protobuf:*</exclude>
114+
</excludes>
115+
</artifactSet>
116+
<filters>
117+
<filter>
118+
<artifact>*:*</artifact>
119+
<excludes>
120+
<exclude>META-INF/*.SF</exclude>
121+
<exclude>META-INF/*.DSA</exclude>
122+
<exclude>META-INF/*.RSA</exclude>
123+
</excludes>
124+
</filter>
125+
</filters>
126+
<transformers>
127+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
128+
<mainClass>org.junit.platform.console.ConsoleLauncher</mainClass>
129+
</transformer>
130+
</transformers>
131+
</configuration>
132+
</execution>
133+
</executions>
134+
</plugin>
135+
</plugins>
136+
</build>
137+
</project>

java-bigquery/google-cloud-bigquery-jdbc/pom.xml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@
6161
<JDBC_TESTS>true</JDBC_TESTS>
6262
</systemPropertyVariables>
6363
</configuration>
64+
<dependencies>
65+
<dependency>
66+
<groupId>org.apache.maven.surefire</groupId>
67+
<artifactId>surefire-junit-platform</artifactId>
68+
<version>3.5.2</version>
69+
</dependency>
70+
</dependencies>
6471
</plugin>
6572
<plugin>
6673
<groupId>org.jacoco</groupId>
@@ -78,9 +85,21 @@
7885
<ignoredUsedUndeclaredDependency>io.grpc:*</ignoredUsedUndeclaredDependency>
7986
</ignoredUsedUndeclaredDependencies>
8087
</configuration>
81-
</plugin>
82-
<plugin>
83-
<groupId>org.apache.maven.plugins</groupId>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-jar-plugin</artifactId>
92+
<version>3.4.2</version>
93+
<executions>
94+
<execution>
95+
<goals>
96+
<goal>test-jar</goal>
97+
</goals>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
84103
<artifactId>maven-shade-plugin</artifactId>
85104
<version>3.5.2</version> <!-- Use the latest version -->
86105
<executions>
@@ -300,6 +319,18 @@
300319
<artifactId>mockito-junit-jupiter</artifactId>
301320
<scope>test</scope>
302321
</dependency>
322+
<dependency>
323+
<groupId>org.junit.platform</groupId>
324+
<artifactId>junit-platform-suite-api</artifactId>
325+
<version>1.11.4</version>
326+
<scope>test</scope>
327+
</dependency>
328+
<dependency>
329+
<groupId>org.junit.platform</groupId>
330+
<artifactId>junit-platform-suite-engine</artifactId>
331+
<version>1.11.4</version>
332+
<scope>test</scope>
333+
</dependency>
303334
</dependencies>
304335

305336
<profiles>
@@ -324,6 +355,13 @@
324355
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
325356
</configuration>
326357
</plugin>
358+
<plugin>
359+
<groupId>org.apache.maven.plugins</groupId>
360+
<artifactId>maven-failsafe-plugin</artifactId>
361+
<configuration>
362+
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
363+
</configuration>
364+
</plugin>
327365
</plugins>
328366
</build>
329367
</profile>

0 commit comments

Comments
 (0)