googleapis / googleapis/google-cloud-java

FR - Consistent programmatic configurations to use Emulators

Đang mở
#7,391 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
priority: p4 type: feature request
Ngôn ngữ chính
Java
Star
2.1k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
154

Mô tả

**Is your feature request related to a problem? Please describe.**
Client libraries currently can use emulators by configuring respective environmental variables. However, in the case of dynamically launching emulators during unit/integration tests using JUnit and Testcontainers, each client library needs to be configured programatically. For all of the supported emulators, client library configurations are very different from each other, and mostly not well documented.

See examples:
* https://github.com/testcontainers/testcontainers-java/tree/master/modules/gcloud/src/test/java/org/testcontainers/containers
* https://github.com/testcontainers/testcontainers-java/pull/3466/files#diff-b3bfaf3d049552632101b023cb90f94ae35a3c6eed6de082c99f3f8e2c7be2e4

Client Library | Configure Endpoint
-|-
Datastore | setHost(hostport) + setCredentials
Firestore | setHost(hostport) + setCredentials
Spanner | setEmulatorHost(hostport)
Pub/Sub | setChannelProvider + setCredentialsProvider
Bigtable | setChannelProvider + setCredentialsProvider and also newBuilderForEmulator(host, port)

**Describe the solution you'd like**
A consistent way of setting emulator host and auto configures the emulator credentials. Spanner is the cleanest/best example of this, which is simply `setEmulatorHost(hostport)`.

**Describe alternatives you've considered**

**Additional context**
https://github.com/spring-cloud/spring-cloud-gcp/issues/2589

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.