@@ -6,6 +6,10 @@ PACKAGE_DESTINATION=$(PWD)/drivers
66SRC ="$(PWD ) "
77skipSurefire ?= true
88skipShade ?= true
9+ excludedGroups ?=
10+ comma := ,
11+ empty :=
12+ space := $(empty ) $(empty )
913JDBC_DRIVER_VERSION = $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
1014JDBC_JAR = $(PACKAGE_DESTINATION ) /google-cloud-bigquery-jdbc-$(JDBC_DRIVER_VERSION ) -all.jar
1115
@@ -33,10 +37,12 @@ unittest: |
3337 -Dclirr.skip=true \
3438 -Denforcer.skip=true \
3539 -Dtest=$(test ) \
40+ -DexcludedGroups=" $( excludedGroups) " \
3641 test
3742
3843# Important: By default, this command will skip unittests & uberjar build.
3944# To include unit tests, run: make integration-test skipSurefire=false
45+ # To exclude test tags/groups, run: make integration-test excludedGroups="known_issues"
4046integration-test :
4147 mvn -B -ntp \
4248 -Penable-integration-tests \
@@ -47,17 +53,18 @@ integration-test:
4753 -Denforcer.skip=true \
4854 -Dit.failIfNoSpecifiedTests=true \
4955 -Dit.test=$(test ) \
56+ -DexcludedGroups=" $( excludedGroups) " \
5057 integration-test \
5158 verify
5259
5360unit-test-coverage :
54- $(MAKE ) unittest
61+ $(MAKE ) unittest excludedGroups= " $( excludedGroups ) "
5562 mvn -B -ntp jacoco:report
5663 BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout ) ; \
5764 cd $$ BUILD_DIR/site && zip -r $$ OLDPWD/jacoco-unittests.zip jacoco && cd $$ OLDPWD
5865
5966full-coverage :
60- $(MAKE ) integration-test skipSurefire=false test=ITBigQueryJDBCTest,ITNightlyBigQueryTest
67+ $(MAKE ) integration-test skipSurefire=false test=ITBigQueryJDBCTest,ITNightlyBigQueryTest excludedGroups= " $( excludedGroups ) "
6168 mvn -B -ntp jacoco:report
6269 BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout ) ; \
6370 cd $$ BUILD_DIR/site && zip -r $$ OLDPWD/jacoco-full.zip jacoco && cd $$ OLDPWD
@@ -70,10 +77,10 @@ package:
7077 cp target/google-cloud-bigquery-jdbc-* -all.jar $(PACKAGE_DESTINATION ) /
7178
7279build-it-standalone :
73- mvn -Dmaven.test.skip=true package -f pom-it.xml -Dbigquery-jdbc.version=$(JDBC_DRIVER_VERSION )
80+ mvn clean package -f pom-it.xml -Dmaven.test.skip=true -Dbigquery-jdbc.version=$(JDBC_DRIVER_VERSION )
7481
7582run-it-standalone :
76- java -cp $(JDBC_JAR ) :target-it/* org.junit.platform.console.ConsoleLauncher --select-class com.google.cloud.bigquery.jdbc.it.suites.ITDriverAgnosticTests
83+ java -cp " $( JDBC_JAR) :target-it/*" org.junit.platform.console.ConsoleLauncher --select-class com.google.cloud.bigquery.jdbc.it.suites.ITDriverAgnosticTests $( foreach tag, $( subst $( comma ) , $( space ) , $( excludedGroups ) ) ,--exclude-tag $( tag ) )
7784
7885
7986# Commands for dockerized environments
@@ -143,14 +150,14 @@ docker-package: docker-build
143150 cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-* -all.jar /pkg "
144151
145152docker-unittest : |
146- $(MAKE ) .docker-run args=" make unittest test=$( test) "
153+ $(MAKE ) .docker-run args=" make unittest test=$( test) excludedGroups=' $( excludedGroups ) ' "
147154
148155docker-integration-test : .check-env
149- $(MAKE ) .docker-run args=" make integration-test test=$( test) skipSurefire=$( skipSurefire) "
156+ $(MAKE ) .docker-run args=" make integration-test test=$( test) skipSurefire=$( skipSurefire) excludedGroups=' $( excludedGroups ) ' "
150157
151158docker-proxy-integration-test : .check-env docker-proxy-build
152159 $(MAKE ) docker-integration-test CONTAINER_NAME=$(PROXY_CONTAINER_NAME ) BIGQUERY_URL_FLAGS=" ProxyHost=127.0.0.1;ProxyPort=3128;"
153160
154161docker-coverage :
155- $(MAKE ) .docker-run args=" make unit-test-coverage"
156- $(MAKE ) .docker-run args=" make full-coverage"
162+ $(MAKE ) .docker-run args=" make unit-test-coverage excludedGroups=' $( excludedGroups ) ' "
163+ $(MAKE ) .docker-run args=" make full-coverage excludedGroups=' $( excludedGroups ) ' "
0 commit comments