Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# the branch into which the pull request is merged
base_branch: main
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
Expand Down
16 changes: 9 additions & 7 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ integration)
verify
RETURN_CODE=$?
;;
integration-directpath-enabled)
integration-regular-sessions)
mvn -B ${INTEGRATION_TEST_ARGS} \
-ntp \
-Penable-integration-tests \
Expand All @@ -113,13 +113,13 @@ integration-directpath-enabled)
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.main.skip=true \
-Dspanner.testenv.instance=projects/span-cloud-testing/instances/spanner-java-client-directpath \
-Dspanner.gce.config.project_id=span-cloud-testing \
-Dspanner.gce.config.project_id=gcloud-devel \
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-regular-sessions \
-fae \
verify
RETURN_CODE=$?
;;
integration-multiplexed-sessions-enabled)
integration-directpath-enabled)
mvn -B ${INTEGRATION_TEST_ARGS} \
-ntp \
-Penable-integration-tests \
Expand All @@ -129,7 +129,7 @@ integration-multiplexed-sessions-enabled)
-Denforcer.skip=true \
-Dmaven.main.skip=true \
-Dspanner.gce.config.project_id=gcloud-devel \
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-multiplexed-sessions \
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-directpath \
-fae \
verify
RETURN_CODE=$?
Expand Down Expand Up @@ -184,12 +184,14 @@ integration-cloud-staging|integration-cloud-staging-directpath-enabled)
;;
graalvm)
# Run Unit and Integration Tests with Native Image
mvn test -Pnative -Penable-integration-tests -Dspanner.gce.config.project_id=gcloud-devel -Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests
# NOTE: These integration tests run on the Emulator.
mvn test -Pnative -Penable-integration-tests -Dspanner.gce.config.project_id=gcloud-devel -Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-graalvm
RETURN_CODE=$?
;;
graalvm17)
# Run Unit and Integration Tests with Native Image
mvn test -Pnative -Penable-integration-tests -Dspanner.gce.config.project_id=gcloud-devel -Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests
# NOTE: These integration tests run on the Emulator.
mvn test -Pnative -Penable-integration-tests -Dspanner.gce.config.project_id=gcloud-devel -Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-graalvm
RETURN_CODE=$?
;;
slowtests)
Expand Down
4 changes: 2 additions & 2 deletions .kokoro/presubmit/integration-directpath-enabled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ env_vars: {

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-client-testing"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-client-testing"
value: "java-it-service-account"
}

env_vars: {
Expand Down
48 changes: 0 additions & 48 deletions .kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env_vars: {

env_vars: {
key: "JOB_TYPE"
value: "integration"
value: "integration-regular-sessions"
}

# TODO: remove this after we've migrated all tests and scripts
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.68.0</version>
<version>26.69.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-spanner'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-spanner:6.101.1'
implementation 'com.google.cloud:google-cloud-spanner:6.102.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.101.1"
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.102.0"
```

## Authentication
Expand Down Expand Up @@ -731,7 +731,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.101.1
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.102.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
3 changes: 3 additions & 0 deletions google-cloud-spanner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<spanner.testenv.instance>${spanner.testenv.instance}</spanner.testenv.instance>
<spanner.gce.config.project_id>${spanner.gce.config.project_id}</spanner.gce.config.project_id>
<spanner.testenv.kms_key.name>${spanner.testenv.kms_key.name}</spanner.testenv.kms_key.name>
<java.util.logging.config.file>logging.properties</java.util.logging.config.file>
</systemPropertyVariables>

</configuration>
Expand All @@ -88,6 +89,7 @@
<spanner.testenv.instance>${spanner.testenv.instance}</spanner.testenv.instance>
<spanner.gce.config.project_id>${spanner.gce.config.project_id}</spanner.gce.config.project_id>
<spanner.testenv.kms_key.name>${spanner.testenv.kms_key.name}</spanner.testenv.kms_key.name>
<java.util.logging.config.file>logging.properties</java.util.logging.config.file>
</systemPropertyVariables>
<forkedProcessTimeoutInSeconds>3000</forkedProcessTimeoutInSeconds>
</configuration>
Expand Down Expand Up @@ -124,6 +126,7 @@
<buildArg>-Dspanner.testenv.instance=${spanner.testenv.instance}</buildArg>
<buildArg>-Dspanner.gce.config.project_id=${spanner.gce.config.project_id}</buildArg>
<buildArg>-Dspanner.testenv.kms_key.name=${spanner.testenv.kms_key.name}</buildArg>
<buildArg>-Djava.util.logging.config.file=logging.properties</buildArg>
</buildArgs>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ protected void before() throws Throwable {
.anyMatch(testEnvOption -> TestEnvOptions.USE_END_TO_END_TRACING.equals(testEnvOption))) {
// OpenTelemetry set up for enabling End to End tracing for all integration test env.
// The gRPC stub and connections are created during test env set up using SpannerOptions and
// are
// reused for executing statements.
// are reused for executing statements.
options = spannerOptionsWithEndToEndTracing(options);
}
String instanceProperty = System.getProperty(TEST_INSTANCE_PROPERTY, "");
Expand Down Expand Up @@ -293,7 +292,7 @@ static boolean isRetryableResourceExhaustedException(SpannerException exception)
}

private void cleanUpOldDatabases(InstanceId instanceId) {
long OLD_DB_THRESHOLD_SECS = TimeUnit.SECONDS.convert(6L, TimeUnit.HOURS);
long OLD_DB_THRESHOLD_SECS = TimeUnit.SECONDS.convert(2L, TimeUnit.HOURS);
Timestamp currentTimestamp = Timestamp.now();
int numDropped = 0;
String TEST_DB_REGEX = "(testdb_(.*)_(.*))|(mysample-(.*))";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.concurrent.TimeUnit;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Logger;
import java.util.logging.StreamHandler;
Expand Down Expand Up @@ -211,7 +212,8 @@ private void attachLogCapturer() {
currentLogger = currentLogger.getParent();
}
if (handlers.length == 0) {
throw new IllegalStateException("no handlers found for logger");
handlers = new Handler[1];
handlers[0] = new ConsoleHandler();
}
customLogHandler = new StreamHandler(logCapturingStream, handlers[0].getFormatter());
useParentHandlers = log.getUseParentHandlers();
Expand Down Expand Up @@ -267,6 +269,7 @@ public void testRemoveConnectionConnectionAlreadyRemoved() {

@Test
public void testCloseSpanner() {
attachLogCapturer();
SpannerPool pool = createSubjectAndMocks();
Spanner spanner = pool.getSpanner(options1, connection1);
// verify that closing is not possible until all connections have been removed
Expand Down
7 changes: 7 additions & 0 deletions google-cloud-spanner/src/test/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.level=INFO
.handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.Logger.useParentHandlers=true

# Set log level to WARN for SpannerImpl to prevent log spamming of the Spanner configuration.
com.google.cloud.spanner.SpannerImpl.LEVEL=WARN