| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
you can run the tests locally with poetry install -E cosmosdb --with dev && poetry run pytest -s modules/cosmosdb/tests in case it helps you. i was able to validate that the waiting you are doing is in fact working - the log, the wait for url, etc, I suspect the emulator just needs more than two minutes to startup and is timing out? not sure. |
Sorry, something went wrong.
|
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) $ time pytest -s modules/cosmosdb/tests =========================================================================================== test session starts ============================================================================================ platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.4.0 rootdir: /tmp/tmp.olcVZbq8gB/testcontainers-python configfile: pyproject.toml plugins: asyncio-0.23.5, anyio-4.3.0, cov-4.1.0 asyncio: mode=strict collected 1 item modules/cosmosdb/tests/test_cosmosdb.py::test_docker_run Pulling image testcontainers/ryuk:0.7.0 ---------------------------------------------------------------------------------------------- live log call ----------------------------------------------------------------------------------------------- INFO testcontainers.core.container:container.py:88 Pulling image testcontainers/ryuk:0.7.0 Container started: 958785fad0f5 INFO testcontainers.core.container:container.py:101 Container started: 958785fad0f5 Waiting for container <Container: 958785fad0f5> with image testcontainers/ryuk:0.7.0 to be ready ... INFO testcontainers.core.waiting_utils:waiting_utils.py:52 Waiting for container <Container: 958785fad0f5> with image testcontainers/ryuk:0.7.0 to be ready ... Pulling image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest INFO testcontainers.core.container:container.py:88 Pulling image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest Container started: 2435177c5b4e INFO testcontainers.core.container:container.py:101 Container started: 2435177c5b4e Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... INFO testcontainers.core.waiting_utils:waiting_utils.py:52 Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... INFO testcontainers.core.waiting_utils:waiting_utils.py:52 Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... INFO testcontainers.core.waiting_utils:waiting_utils.py:52 Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... INFO testcontainers.core.waiting_utils:waiting_utils.py:52 Waiting for container <Container: 2435177c5b4e> with image mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest to be ready ... (...) ================================================================================ 1 passed, 2 warnings in 105.71s (0:01:45) ================================================================================= real 1m45,927s user 0m0,875s sys 0m0,079s |
Sorry, something went wrong.
|
@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 ... |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
…he MongoDB testcontainer
|
@alexanderankin Hi, i'd like to try running the tests workflows with this. is it possible ? thank you |
Sorry, something went wrong.
|
looks like "failing after 10m" still taking a while |
Sorry, something went wrong.
…rts, and tests are run concurrently for several python versions)
|
@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 |
Sorry, something went wrong.
|
What does this mean?
Wondering, since I am not aware of any limitation in this regard from our Java implementation. |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
|
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) |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
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.. |
Sorry, something went wrong.
|
should i just clean up and attempt to merge what is in here? |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
|
present pr - main...a85a9b6 rebased - main...pr/cosmosdb_emulator.tmp rebased main - main...pr/cosmosdb_emulator.tmp2 |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
🤖 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>
| Back | FazBrowse Home | New Git URL |
Adds support for the CosmosDB Emulator container