-
Notifications
You must be signed in to change notification settings - Fork 292
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
fix(cosmosdb): Add support for the CosmosDB Emulator #579
fix(cosmosdb): Add support for the CosmosDB Emulator #579
Conversation
e333a94
to
139eb71
Compare
since we do not count community features towards testcontainers features, i have tagged this PR with feat-community but renamed the PR to "fix" - i have fixed the docs build for you but i am not going to get the module tests to pass, they seemed to not pass on the last run |
you can run the tests locally with |
thank you @alexanderankin for looking into this. Indeed, the container unfortunately takes a while to start up, and I believe you're correct: this is timeout-related failure. locally, the test passes, and runs consistently in ~1.46s in avg (avg calculated over 100 successive test runs. all passed)
|
824500e
to
cd834e9
Compare
@alexanderankin could we move this PR back to a draft ? it'll take more time than i expected to have something proper:
I plan on removing the endpoint readiness check from the module, and document how one would proceed to check for that. Sorry for the inconvenience this has been ... |
no worries, if you can get the tests to pass we can merge as is and make changes later as well. i noticed the port limitation myself so i wouldn't worry about changing that if you can change the timeout configuration during tests so that the tests do actually pass - this is probably the most critical thing - as it is demonstrated in #578, #532 |
6f1be19
to
500bc53
Compare
…he MongoDB testcontainer
@alexanderankin Hi, i'd like to try running the tests workflows with this. is it possible ? thank you |
looks like "failing after 10m" still taking a while |
…rts, and tests are run concurrently for several python versions)
5c59135
to
a85a9b6
Compare
@alexanderankin looks like we're good now: I missed the part where embeded code examples were actually executed as part of the CI I had to skip the examples from this module from being executed unrelated question: shall I squash my commits ? Thanks |
What does this mean?
Wondering, since I am not aware of any limitation in this regard from our Java implementation. |
Now that you mention it, it sounds like BS. To be honest I read that on a couple of occasions and did not bother to check 👎 Thank you for pointing that out |
squashing the commits is not necessary. i am really not sure how it works in java because when i was stepping through the python driver, it had some abstractions around determining this port and it was not clear how to inform the azure cosmos driver that it should be using a different port (from the standpoint of my debugging - perhaps if i started from the docs instead it would have been clear) |
cosmosdb client can use two modes: direct and gateway. gateway works in java with random ports and direct is not supported. See testcontainers/testcontainers-java#5518 |
Hello, when it will be added? I too implemented comsosdb emulator support but @mbenabda did it better.
let's be realistic, this emulator kinda sucks and is heavily restricted. I had the problem with binding ports other than 8081 not because of emulator, but because of python's cosmosdb client ignoring my port configuration. Also official documentation publishes ports 10250-10255 and they do not even say what they are for nor if they are needed.. |
should i just clean up and attempt to merge what is in here? |
@saikotek @alexanderankin Sorry, I didn't find the time to get back to this these past couple of weeks. @alexanderankin feel free clean up and merge, it should work with the caveat of binding static ports. I'll get back to this as soon as things calm down on my side (hopefully starting from next week), and if you've merged by then, open another PR to improve on this basis. |
present pr - main...a85a9b6 rebased - main...pr/cosmosdb_emulator.tmp rebased main - main...pr/cosmosdb_emulator.tmp2 |
a85a9b6
to
fd04554
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #579 +/- ##
=======================================
Coverage ? 76.26%
=======================================
Files ? 11
Lines ? 573
Branches ? 83
=======================================
Hits ? 437
Misses ? 110
Partials ? 26 ☔ View full report in Codecov by Sentry. |
6fc5b9a
to
c90b36f
Compare
8541879
to
d57fbcc
Compare
🤖 I have created a release *beep* *boop* --- ## [4.7.0](testcontainers-v4.6.0...testcontainers-v4.7.0) (2024-06-28) ### Features * **core:** Added Generic module ([#612](#612)) ([e575b28](e575b28)) * **core:** allow custom dockerfile path for image build and bypassing build cache ([#615](#615)) ([ead0f79](ead0f79)), closes [#610](#610) * **core:** DockerCompose.stop now stops only services that it starts (does not stop the other services) ([#620](#620)) ([e711800](e711800)) ### Bug Fixes * **ollama:** Add support for ollama module ([#618](#618)) ([5442d05](5442d05)) * **cosmosdb:** Add support for the CosmosDB Emulator ([#579](#579)) ([8045a80](8045a80)) * improve ollama docs, s/ollama_dir/ollama_home/g ([#619](#619)) ([27f2a6b](27f2a6b)) * **kafka:** Add Kraft to Kafka containers ([#611](#611)) ([762d2a2](762d2a2)) ### Documentation * **contributing:** add contribution and new-container guide ([#460](#460)) ([3519f4b](3519f4b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [4.7.1](testcontainers-v4.7.0...testcontainers-v4.7.1) (2024-07-02) ### Bug Fixes * **core:** bad rebase from [#579](#579) ([#635](#635)) ([4766e48](4766e48)) * **modules:** Mailpit Container ([#625](#625)) ([0b866ff](0b866ff)) * **modules:** SFTP Server Container ([#629](#629)) ([2e7dbf1](2e7dbf1)) * **network:** Now able to use Network without context, and has labels to be automatically cleaned up ([#627](#627)) ([#630](#630)) ([e93bc29](e93bc29)) * **postgres:** get_connection_url(driver=None) should return postgres://... ([#588](#588)) ([01d6c18](01d6c18)), closes [#587](#587) * update test module import ([#623](#623)) ([16f6ca4](16f6ca4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Adds support for the CosmosDB Emulator container