Skip to content

Commit 91eb471

Browse files
authored
chore(jdbc bq): makefile commands to run standalone IT tests (#12666)
1 parent 684511a commit 91eb471

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
drivers/
1+
drivers/**
2+
target-it/**

java-bigquery/google-cloud-bigquery-jdbc/Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ CONTAINER_NAME=jdbc
44
PACKAGE_DESTINATION=$(PWD)/drivers
55
SRC="$(PWD)"
66
skipSurefire ?= true
7+
JDBC_DRIVER_VERSION = $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
8+
JDBC_JAR = $(PACKAGE_DESTINATION)/google-cloud-bigquery-jdbc-$(JDBC_DRIVER_VERSION)-all.jar
9+
710

811
# no indendation for ifndef\endif due to their evaluation before execution
912
.check-env: |
@@ -59,14 +62,15 @@ package:
5962
mvn clean package \
6063
-DincludeScope=runtime \
6164
-Dmaven.test.skip=true
62-
mvn dependency:copy-dependencies \
63-
-DincludeScope=runtime
64-
${MAKE} generate-dependency-list
65-
66-
generate-dependency-list:
67-
mvn -B dependency:list \
68-
-f pom.xml \
69-
-DincludeScope=runtime | grep :jar: | sed -E "s/^.* ([^: ]+):([^:]+):([^:]+):([^:]+).*/<dependency><groupId>\1<\/groupId><artifactId>\2<\/artifactId><version>\4<\/version><\/dependency>/g" > dependencies.txt
65+
mkdir -p $(PACKAGE_DESTINATION)
66+
cp target/google-cloud-bigquery-jdbc-*-all.jar $(PACKAGE_DESTINATION)/
67+
68+
build-it-standalone:
69+
mvn -Dmaven.test.skip=true package -f pom-it.xml
70+
71+
run-it-standalone:
72+
java -cp $(JDBC_JAR):target-it/* org.junit.platform.console.ConsoleLauncher --select-class com.google.cloud.bigquery.jdbc.it.suites.ITDriverAgnosticTests
73+
7074

7175
# Commands for dockerized environments
7276
.docker-run: |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
</dependencies>
8787

8888
<build>
89+
<directory>target-it</directory>
8990
<plugins>
9091
<plugin>
9192
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)