Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Add spanner (emulator) module #862

Open
TwanVB opened this issue Apr 2, 2023 · 1 comment
Open

[Enhancement]: Add spanner (emulator) module #862

TwanVB opened this issue Apr 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@TwanVB
Copy link

TwanVB commented Apr 2, 2023

Problem

We are runnign dontnet services on GCP, where spanner is our database service of choice for some services. Running integration tests on this, controlled from unit test style code is part of our process. Test containers is ideal for this, however so far there is no spanner module available.

Solution

We created a testcontainers.spanner module for internal use and like to contribute it back to the community.
We like to create a feature branch on this, make the adoptions needed to make it an official module and integrate in in the testcontainers CI and ultimately raise a pull reqwuest for this.

The module now contains these functionalities:

  • On the builder
    -- WithInstanceId
    -- WIthProjectId
    -- WithDabaseId
  • On the SpannerContainer class
    -- Expose the mapped port for grpc
    -- Expose the port mapped for rest
    -- expose the connectionstring
    -- On start set required environmentvariable in dotnet for connecting to a spanner emulator
    -- On start create the project and database on the emulator instanc
    -- Expose an execute ddl method to simplify defining the datamodel

Benefit

Other developers in need of testing locally or in CI processes against a spanner will need less code and time to set up their testcontainer. The testcontainers module set will be bigger, increasing the maturity of the suite.

Alternatives

No alternatives that I'm aware of

Would you like to help contributing this enhancement?

Yes

@TwanVB TwanVB added the enhancement New feature or request label Apr 2, 2023
@HofmeisterAn
Copy link
Collaborator

I would like to add the reference to the Java implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants