-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
feat: Add Google Cloud Storage API (fake-gcs-server) module #1023
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
there is one problem return base.Init()
.WithImage(GCSImage)
.WithPortBinding(GCSPort, newPort)
.WithCommand("-scheme", "http")
.WithCommand("-backend", "memory")
.WithCommand("-external-url", $"http://localhost:{newPort}")
.WithCommand("-port", newPort.ToString())
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPath("/").ForPort(newPort).ForStatusCode(HttpStatusCode.NotFound))); I have to pass acutal port into -external-url paramenter. |
this is how docker config shoud looks like |
Hi 👋 do you mean the actual random assigned host port? It is not very common that a services running inside a container requires it, but you can configure something similar like Kafka and utilize the testcontainers-dotnet/src/Testcontainers.Kafka/KafkaBuilder.cs Lines 65 to 66 in 44a1d3a
The testcontainers-dotnet/src/Testcontainers.Kafka/KafkaBuilder.cs Lines 82 to 87 in 44a1d3a
|
Yeah, it’s because of container, I have no idea why. |
@HofmeisterAn the problem is I have to pass port number into paramter so for code |
if I do like hits return base.Init()
.WithImage(GCSImage)
.WithPortBinding(GCSPort, GCSPort)
.WithCommand("-scheme", "http")
.WithCommand("-backend", "memory")
.WithCommand("-external-url", $"http://localhost:{GCSPort}")
.WithCommand("-port", $"{GCSPort}")
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
request.ForPath("/").ForPort(GCSPort).ForStatusCode(HttpStatusCode.NotFound))); then all is fine, and it works. but it's not possible to run several containers at the same time |
As mentioned in my previous comment, you need a configuration similar to Kafka:
|
ok if I do [Collection("Google")] for collections thet all is fine |
I am sorry, I do not understand. Modules must work with random assigned host ports; we cannot accept the pull request using fixed host ports. You can find further details in our best practices. |
@HofmeisterAn that was my random thoughts, anyway thanks for your help, now it works fine =) |
This is really amazing suggeest! thanks a lot! |
Now it’s ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 🙌. I have only a few minor suggestions to improve the module. In addition to my comments below, can we rename GCS
to Gcs
to align with the other modules?
tests/Testcontainers.FakeGCSServer.Tests/FakeGCSServerContainerTest.cs
Outdated
Show resolved
Hide resolved
tests/Testcontainers.FakeGCSServer.Tests/FakeGCSServerContainerTest.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
…rTest.cs Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
…rTest.cs Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
fixed, but with some reason one pipline is borken, I did that? |
aH I see |
@HofmeisterAn thansks a lot! This is super cool finding! |
@HofmeisterAn Hi! Thanks for merging this request! |
I have not planned a release yet. I want to make some minor changes in the next days, but I need a short break as I am feeling drained. |
Sure! I'm just checking to see when I can throw out my old implementation and replace it with a nice nuget package =) |
What does this PR do?
Add Google Cloud Storage to testcontainer
Why is it important?
Now testcontainer will have Azure, AWS and GCP for tests
Related issues