-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test(bigquery-jdbc): add test tags & ability to skip them #13916
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,10 @@ PACKAGE_DESTINATION=$(PWD)/drivers | |
| SRC="$(PWD)" | ||
| skipSurefire ?= true | ||
| skipShade ?= true | ||
| excludedGroups ?= | ||
| comma := , | ||
| empty := | ||
| space := $(empty) $(empty) | ||
| JDBC_DRIVER_VERSION = $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
| JDBC_JAR = $(PACKAGE_DESTINATION)/google-cloud-bigquery-jdbc-$(JDBC_DRIVER_VERSION)-all.jar | ||
|
|
||
|
|
@@ -33,10 +37,12 @@ unittest: | | |
| -Dclirr.skip=true \ | ||
| -Denforcer.skip=true \ | ||
| -Dtest=$(test) \ | ||
| -DexcludedGroups=$(excludedGroups) \ | ||
| test | ||
|
|
||
| # Important: By default, this command will skip unittests & uberjar build. | ||
| # To include unit tests, run: make integration-test skipSurefire=false | ||
| # To exclude test tags/groups, run: make integration-test excludedGroups="known_issues" | ||
| integration-test: | ||
| mvn -B -ntp \ | ||
| -Penable-integration-tests \ | ||
|
|
@@ -47,17 +53,18 @@ integration-test: | |
| -Denforcer.skip=true \ | ||
| -Dit.failIfNoSpecifiedTests=true \ | ||
| -Dit.test=$(test) \ | ||
| -DexcludedGroups=$(excludedGroups) \ | ||
| integration-test \ | ||
| verify | ||
|
|
||
| unit-test-coverage: | ||
| $(MAKE) unittest | ||
| $(MAKE) unittest excludedGroups=$(excludedGroups) | ||
| mvn -B -ntp jacoco:report | ||
| BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout); \ | ||
| cd $$BUILD_DIR/site && zip -r $$OLDPWD/jacoco-unittests.zip jacoco && cd $$OLDPWD | ||
|
|
||
| full-coverage: | ||
| $(MAKE) integration-test skipSurefire=false test=ITBigQueryJDBCTest,ITNightlyBigQueryTest | ||
| $(MAKE) integration-test skipSurefire=false test=ITBigQueryJDBCTest,ITNightlyBigQueryTest excludedGroups=$(excludedGroups) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
| mvn -B -ntp jacoco:report | ||
| BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout); \ | ||
| cd $$BUILD_DIR/site && zip -r $$OLDPWD/jacoco-full.zip jacoco && cd $$OLDPWD | ||
|
|
@@ -70,10 +77,10 @@ package: | |
| cp target/google-cloud-bigquery-jdbc-*-all.jar $(PACKAGE_DESTINATION)/ | ||
|
|
||
| build-it-standalone: | ||
| mvn -Dmaven.test.skip=true package -f pom-it.xml -Dbigquery-jdbc.version=$(JDBC_DRIVER_VERSION) | ||
| mvn clean package -f pom-it.xml -Dmaven.test.skip=true -Dbigquery-jdbc.version=$(JDBC_DRIVER_VERSION) | ||
|
|
||
| run-it-standalone: | ||
| java -cp $(JDBC_JAR):target-it/* org.junit.platform.console.ConsoleLauncher --select-class com.google.cloud.bigquery.jdbc.it.suites.ITDriverAgnosticTests | ||
| 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)) | ||
|
|
||
|
|
||
| # Commands for dockerized environments | ||
|
|
@@ -143,14 +150,14 @@ docker-package: docker-build | |
| cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*-all.jar /pkg " | ||
|
|
||
| docker-unittest: | | ||
| $(MAKE) .docker-run args="make unittest test=$(test)" | ||
| $(MAKE) .docker-run args="make unittest test=$(test) excludedGroups=$(excludedGroups)" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
|
|
||
| docker-integration-test: .check-env | ||
| $(MAKE) .docker-run args="make integration-test test=$(test) skipSurefire=$(skipSurefire)" | ||
| $(MAKE) .docker-run args="make integration-test test=$(test) skipSurefire=$(skipSurefire) excludedGroups=$(excludedGroups)" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
|
|
||
| docker-proxy-integration-test: .check-env docker-proxy-build | ||
| $(MAKE) docker-integration-test CONTAINER_NAME=$(PROXY_CONTAINER_NAME) BIGQUERY_URL_FLAGS="ProxyHost=127.0.0.1;ProxyPort=3128;" | ||
|
|
||
| docker-coverage: | ||
| $(MAKE) .docker-run args="make unit-test-coverage" | ||
| $(MAKE) .docker-run args="make full-coverage" | ||
| $(MAKE) .docker-run args="make unit-test-coverage excludedGroups=$(excludedGroups)" | ||
| $(MAKE) .docker-run args="make full-coverage excludedGroups=$(excludedGroups)" | ||
|
Comment on lines
+162
to
+163
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
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.
If
excludedGroupscontains spaces (e.g.,excludedGroups="known_issue, advanced"), passing it unquoted to$(MAKE)will causemaketo treat the words after the space as separate targets to build, leading to a build failure. Wrapping the variable in double quotes prevents this word splitting.