Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Create a test rule for Spanner emulator #2318

Closed
dmitry-s opened this issue Apr 14, 2020 · 6 comments · May be fixed by #2357
Closed

Create a test rule for Spanner emulator #2318

dmitry-s opened this issue Apr 14, 2020 · 6 comments · May be fixed by #2357

Comments

@dmitry-s
Copy link
Contributor

The rule should automatically start and stop the emulator.

@eddumelendez
Copy link
Contributor

eddumelendez commented Apr 28, 2020

@dmitry-s have a few questions regarding to this. As far as I can see, there is PubSubEmulator. So,

  • Should we use this existing rule to create SpannerEmulator?
  • Should PubSubEmulator and SpannerEmulator be for public use? Currently, PubSubEmulator is a rule for internal use only.
  • ExternalResource is based on JUnit 4 but I can see that spring-cloud-gcp is supporting 2.3.x, have you considered moving this to JUnit 5 or support both?
  • At the beginning, I though there should be a auto-configuration class to start spanner or pubsub like currently firestore or datastore do.

@dmitry-s
Copy link
Contributor Author

Hi @eddumelendez ,

At this point, Cloud Spanner Emulator set up and start is a multi step process, as it requires installing components of gcloud, installing docker, and also configuring gcloud and creating instances. Because of that I am not sure if we can/should create a rule for Cloud Spanner Emulator.

@meltsufin what do you think?

@meltsufin
Copy link
Contributor

@dmitry-s Docker is only required on Mac and Windows.
Assuming that all of the components are installed, what are your concerns?
Does it make sense to just focus on starting and stopping the emulator, as the issue originally intended.

@saturnism
Copy link
Contributor

saturnism commented May 8, 2020

@meltsufin
Copy link
Contributor

@saturnism The test containers look pretty cool! However, we're providing emulator support here without the use of containers (except for Spanner).
Maybe there is still some code we can reuse, I don't know.

@elefeint
Copy link
Contributor

Testcontainers is the way to go for all emulators. We should not be providing separate support; the way I did it for Pub/Sub is more fragile (relies on finding PID, keeps track of subprocesses. meh.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

5 participants