GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp

Improve test experience in Cloud SQL integration

Open
#407 3 comments 0 reactions 0 assignees View on GitHub
cloud-sql dependencies priority: p3 type: enhancement
Dominant language
Java
Stars
551
Forks
349
Avg merge
1d 13h
Merged PRs (30d)
14

Description

When using `spring-cloud-gcp-starter-sql-{postgresql,mysql}`, one needs to explicitly disable these and point Spring to a new datasource in `application-test.properties`:

```properties
spring.cloud.gcp.sql.enabled = false
spring.datasource.url = jdbc:postgresql://localhost:5432/app
spring.datasource.username = postgres
```

This experience can be improved by removing the need to explicitly disable Cloud SQL support during tests. In contrast, Pub/Sub only requires a single property, that is, `spring.cloud.gcp.pubsub.emulator-host`, to get going in tests. In the context of Cloud SQL, an alternative would be introduce a similar `spring.cloud.gcp.sql.emulator-url` property:

```properties
spring.cloud.gcp.sql.emulator-url = jdbc:postgresql://postgres@localhost:5432/app
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.