Skip to content

Commit eb5cf39

Browse files
authored
Merge branch 'main' into test/showcase-retries
2 parents 490cb36 + 550df81 commit eb5cf39

21 files changed

Lines changed: 694 additions & 41 deletions

File tree

.github/workflows/librarian_generation_check.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ jobs:
6666
sudo apt-get update && sudo apt-get install -y maven
6767
fi
6868
mvn -version
69-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
70-
with:
71-
python-version: "3.12"
72-
cache: 'pip'
7369
- name: Run librarian install
7470
run: |
7571
librarian install

.github/workflows/sdk-platform-java-dependency_compatibility_test.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,22 @@ jobs:
9090
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
9191
cd /usr/src/showcase/
9292
tar -xf showcase-*
93+
# Start standard insecure showcase server on default port 7469 for standard integration tests
9394
./gapic-showcase run &
95+
# Start secure TLS showcase server on port 7470 for PQC TLS integration tests
96+
./gapic-showcase run --port 7470 --tls --ca-cert-output-file /tmp/showcase-ca.pem &
97+
# Wait deterministically for both background showcase servers to finish binding ports 7469/7470
98+
# and writing /tmp/showcase-ca.pem. Starting TLS requires RSA key generation and disk I/O,
99+
# which can cause race conditions if tests start before /tmp/showcase-ca.pem is created.
100+
for i in $(seq 1 30); do
101+
if (echo > /dev/tcp/127.0.0.1/7469) 2>/dev/null && \
102+
(echo > /dev/tcp/127.0.0.1/7470) 2>/dev/null && \
103+
[ -f /tmp/showcase-ca.pem ]; then
104+
echo "Showcase servers (ports 7469, 7470) and CA cert ready in attempt $i."
105+
break
106+
fi
107+
sleep 0.2
108+
done
94109
cd -
95110
working-directory: sdk-platform-java
96111

.github/workflows/showcase.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,22 @@ jobs:
6161
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
6262
cd /usr/src/showcase/
6363
tar -xf showcase-*
64+
# Start standard insecure showcase server on default port 7469 for standard integration tests
6465
./gapic-showcase run &
66+
# Start secure TLS showcase server on port 7470 for PQC TLS integration tests
67+
./gapic-showcase run --port 7470 --tls --ca-cert-output-file /tmp/showcase-ca.pem &
68+
# Wait deterministically for both background showcase servers to finish binding ports 7469/7470
69+
# and writing /tmp/showcase-ca.pem. Starting TLS requires RSA key generation and disk I/O,
70+
# which can cause race conditions if tests start before /tmp/showcase-ca.pem is created.
71+
for i in $(seq 1 30); do
72+
if (echo > /dev/tcp/127.0.0.1/7469) 2>/dev/null && \
73+
(echo > /dev/tcp/127.0.0.1/7470) 2>/dev/null && \
74+
[ -f /tmp/showcase-ca.pem ]; then
75+
echo "Showcase servers (ports 7469, 7470) and CA cert ready in attempt $i."
76+
break
77+
fi
78+
sleep 0.2
79+
done
6580
cd -
6681
- name: Showcase integration tests
6782
working-directory: java-showcase
@@ -160,7 +175,22 @@ jobs:
160175
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
161176
cd /usr/src/showcase/
162177
tar -xf showcase-*
178+
# Start standard insecure showcase server on default port 7469 for standard integration tests
163179
./gapic-showcase run &
180+
# Start secure TLS showcase server on port 7470 for PQC TLS integration tests
181+
./gapic-showcase run --port 7470 --tls --ca-cert-output-file /tmp/showcase-ca.pem &
182+
# Wait deterministically for both background showcase servers to finish binding ports 7469/7470
183+
# and writing /tmp/showcase-ca.pem. Starting TLS requires RSA key generation and disk I/O,
184+
# which can cause race conditions if tests start before /tmp/showcase-ca.pem is created.
185+
for i in $(seq 1 30); do
186+
if (echo > /dev/tcp/127.0.0.1/7469) 2>/dev/null && \
187+
(echo > /dev/tcp/127.0.0.1/7470) 2>/dev/null && \
188+
[ -f /tmp/showcase-ca.pem ]; then
189+
echo "Showcase servers (ports 7469, 7470) and CA cert ready in attempt $i."
190+
break
191+
fi
192+
sleep 0.2
193+
done
164194
cd -
165195
- name: Showcase integration tests
166196
working-directory: java-showcase

.github/workflows/update_librarian_googleapis.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ jobs:
114114
sudo apt-get update && sudo apt-get install -y maven
115115
fi
116116
mvn -version
117-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
118-
if: steps.detect_librarian.outputs.has_changes == 'true'
119-
with:
120-
python-version: "3.12"
121-
cache: 'pip'
122117
- name: Run librarian install
123118
if: steps.detect_librarian.outputs.has_changes == 'true'
124119
run: |

java-bigquery-jdbc/Makefile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PACKAGE_DESTINATION=$(PWD)/drivers
66
SRC="$(PWD)"
77
skipSurefire ?= true
88
skipShade ?= true
9+
excludedGroups ?=
10+
comma := ,
11+
empty :=
12+
space := $(empty) $(empty)
913
JDBC_DRIVER_VERSION = $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
1014
JDBC_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"
4046
integration-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

5360
unit-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

5966
full-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

7279
build-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

7582
run-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

145152
docker-unittest: |
146-
$(MAKE) .docker-run args="make unittest test=$(test)"
153+
$(MAKE) .docker-run args="make unittest test=$(test) excludedGroups='$(excludedGroups)'"
147154

148155
docker-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

151158
docker-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

154161
docker-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)'"

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITAuthTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.Arrays;
3636
import org.junit.jupiter.api.Assertions;
3737
import org.junit.jupiter.api.Disabled;
38+
import org.junit.jupiter.api.Tag;
3839
import org.junit.jupiter.api.Test;
3940
import org.junit.jupiter.params.ParameterizedTest;
4041
import org.junit.jupiter.params.provider.CsvSource;
@@ -110,6 +111,7 @@ public void testValidServiceAccountAuthenticationOAuthPvtKeyAsPath()
110111
}
111112

112113
@Test
114+
@Tag("advanced")
113115
public void testValidServiceAccountAuthenticationViaEmailAndPkcs8Key()
114116
throws SQLException, IOException {
115117
final JsonObject authJson = getAuthJson();
@@ -272,6 +274,7 @@ public void testValidExternalAccountAuthenticationRawJson() throws SQLException
272274
"https://www.googleapis.com/auth/bigquery.readonly, true",
273275
"https://www.googleapis.com/auth/bigquery, false"
274276
})
277+
@Tag("advanced")
275278
public void testValidPreGeneratedAccessTokenAuthentication(String scope, boolean isReadOnly)
276279
throws Exception {
277280
final JsonObject authJson = getAuthJson();
@@ -335,6 +338,7 @@ public void testValidApplicationDefaultCredentialsAuthentication() throws SQLExc
335338
// It requires account to have 'tokenCreator' permission, see
336339
// https://cloud.google.com/docs/authentication/use-service-account-impersonation#required-roles
337340
@Test
341+
@Tag("advanced")
338342
public void testServiceAccountAuthenticationWithImpersonation() throws IOException, SQLException {
339343
final JsonObject authJson = getAuthJson();
340344

@@ -350,6 +354,7 @@ public void testServiceAccountAuthenticationWithImpersonation() throws IOExcepti
350354
// This test uses the same client email for the main authorization and a chain of impersonations.
351355
// It requires the account to have 'tokenCreator' permission on itself.
352356
@Test
357+
@Tag("advanced")
353358
public void testServiceAccountAuthenticationWithChainedImpersonation()
354359
throws IOException, SQLException {
355360
final JsonObject authJson = getAuthJson();

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import org.junit.jupiter.api.AfterAll;
6363
import org.junit.jupiter.api.Assertions;
6464
import org.junit.jupiter.api.BeforeAll;
65+
import org.junit.jupiter.api.Tag;
6566
import org.junit.jupiter.api.Test;
6667

6768
public class ITBigQueryJDBCTest extends ITBase {
@@ -101,6 +102,7 @@ public static void afterClass() throws SQLException {
101102
}
102103

103104
@Test
105+
@Tag("known_issue") // b/539615199
104106
public void testValidAllDataTypesSerializationFromSelectQueryArrowDataset() throws SQLException {
105107
String DATASET = "JDBC_INTEGRATION_DATASET";
106108
String TABLE_NAME = "JDBC_INTEGRATION_ARROW_TEST_TABLE";
@@ -2488,6 +2490,7 @@ private void validate(
24882490
}
24892491

24902492
@Test
2493+
@Tag("known_issue") // b/539615199
24912494
public void validateGetString() throws Exception {
24922495
final ImmutableMap<String, Object> stringResults =
24932496
new ImmutableMap.Builder<String, Object>()
@@ -2660,6 +2663,7 @@ public void validateGetShort() throws Exception {
26602663
}
26612664

26622665
@Test
2666+
@Tag("known_issue") // b/539615199
26632667
public void validateGetTime() throws Exception {
26642668
final ImmutableMap<String, Object> result =
26652669
new ImmutableMap.Builder<String, Object>()
@@ -2698,6 +2702,7 @@ public void validateGetDate() throws Exception {
26982702
}
26992703

27002704
@Test
2705+
@Tag("known_issue") // b/539615199
27012706
public void validateGetTimestamp() throws Exception {
27022707
final ImmutableMap<String, Object> result =
27032708
new ImmutableMap.Builder<String, Object>()

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITConnectionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.junit.jupiter.api.AfterAll;
3939
import org.junit.jupiter.api.BeforeAll;
4040
import org.junit.jupiter.api.Disabled;
41+
import org.junit.jupiter.api.Tag;
4142
import org.junit.jupiter.api.Test;
4243

4344
public class ITConnectionTest {
@@ -61,6 +62,7 @@ public static void afterClass() throws InterruptedException {
6162
}
6263

6364
@Test
65+
@Tag("advanced")
6466
public void testGetMetaData() throws SQLException {
6567
Connection connection = DriverManager.getConnection(ITBase.connectionUrl);
6668
assertFalse(connection.isClosed());

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITDatabaseMetadataTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.junit.jupiter.api.Assertions;
4646
import org.junit.jupiter.api.BeforeAll;
4747
import org.junit.jupiter.api.Disabled;
48+
import org.junit.jupiter.api.Tag;
4849
import org.junit.jupiter.api.Test;
4950

5051
public class ITDatabaseMetadataTest extends ITBase {
@@ -272,6 +273,7 @@ public void testGetPrimaryKeys() throws SQLException {
272273
}
273274

274275
@Test
276+
@Tag("advanced")
275277
public void testTableConstraints() throws SQLException {
276278
Connection connection = DriverManager.getConnection(ITBase.connectionUrl);
277279
ResultSet primaryKey1 =
@@ -390,6 +392,7 @@ public void testGetExportedKeys_noKeys() throws SQLException {
390392
}
391393

392394
@Test
395+
@Tag("advanced")
393396
public void testMetadataResultSetsDoNotInterfere() throws SQLException {
394397
try (Connection connection = DriverManager.getConnection(ITBase.connectionUrl)) {
395398
DatabaseMetaData metaData = connection.getMetaData();
@@ -445,6 +448,7 @@ public void testDatabaseMetadataGetCatalogs() throws SQLException {
445448
}
446449

447450
@Test
451+
@Tag("advanced")
448452
public void testDatabaseMetadataGetProcedures() throws SQLException {
449453

450454
Connection connection = DriverManager.getConnection(ITBase.connectionUrl);
@@ -1188,6 +1192,7 @@ public void testAdditionalProjectsInMetadata() throws SQLException {
11881192
}
11891193

11901194
@Test
1195+
@Tag("advanced")
11911196
public void testFilterTablesOnDefaultDataset_getTables() throws SQLException {
11921197

11931198
String defaultDatasetValue = CONSTRAINTS_DATASET;
@@ -1258,6 +1263,7 @@ public void testFilterTablesOnDefaultDataset_getTables() throws SQLException {
12581263
}
12591264

12601265
@Test
1266+
@Tag("advanced")
12611267
public void testFilterTablesOnDefaultDataset_getColumns() throws SQLException {
12621268
String defaultDatasetValue = CONSTRAINTS_DATASET;
12631269
String tableInDefaultDataset = CONSTRAINTS_TABLE_NAME;

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import java.util.concurrent.atomic.AtomicBoolean;
5353
import org.junit.jupiter.api.AfterAll;
5454
import org.junit.jupiter.api.BeforeAll;
55+
import org.junit.jupiter.api.Tag;
5556
import org.junit.jupiter.api.Test;
5657

5758
public class ITNightlyBigQueryTest extends ITBase {
@@ -1038,6 +1039,7 @@ public void testMultipleExecuteBatches() throws SQLException {
10381039
}
10391040

10401041
@Test
1042+
@Tag("known_issue") // b/539615199
10411043
public void testValidAllDataTypesSerializationFromSelectQuery() throws SQLException {
10421044
String DATASET = "JDBC_INTEGRATION_DATASET";
10431045
String TABLE_NAME = "JDBC_DATATYPES_INTEGRATION_TEST_TABLE";

0 commit comments

Comments
 (0)