testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

Improved Oracle DB module

Open gvenzl opened this issue 2 years ago • 7 comments

Hi,

I took the liberty to improve the Oracle DB module for Testcontainers Python. The PR has several enhancements:

  • Leveraging oracledb thin Python driver
    • This makes Oracle DB tests on CI/CD now possible too
  • Usage of gvenzl/oracle-free image with the latest and greatest Oracle DB version
  • DB version independent readiness check
  • Support for various gvenzl/oracle-free image features (ORACLE_DATABASE, APP_USER, APP_USER_PASSWORD, etc)
  • Tests for Oracle DB for the various combinations

Ideally, some more documentation on how the Container is supposed to be used would be handy but I couldn't really find a good example of how such a ReadMe should be structured. Any things are gladly appreciated!

gvenzl avatar Jun 11 '23 19:06 gvenzl

Looking at the failed job, I'm fairly certain that this was a strange, potentially race condition on that individual execution of the test. All other Oracle DB tests with different Python versions pass, and so did they over at https://github.com/gvenzl/testcontainers-python/actions/runs/5236983249

I have seen situations where Docker Hub refuses to have images pulled if the pull frequency is too high. While I can only guess that something like that may have happened here, it would be great if an administrator could rerun that failed job.

My guess is that it will execute just fine and if not, it will be a clear indicator that there is something off with that particular test that needs fixing.

gvenzl avatar Jun 12 '23 21:06 gvenzl

Yes, looks like it. I've restarted the run. Would it be possible to improve timeout handling so the tests fail earlier? The current setup ran for a few hours before bailing: https://github.com/testcontainers/testcontainers-python/actions/runs/5237034596/jobs/9470709201?pr=363#step:7:291

tillahoffmann avatar Jun 12 '23 22:06 tillahoffmann

Hey @tillahoffmann,

Thanks a lot, it did go through this time!

Happy to increase the timeout if you could point me in the right direction. I didn't deviate from the default 120s and according to the output, that was supposedly used:

FAILED oracle/tests/test_oracle.py::test_docker_run_oracle_with_system_password - TimeoutError: Wait time (120s) exceeded for _connect(args: (), kwargs: {}). Exception: Wait time (120s) exceeded for get_exposed_port(args: (1521,), kwargs: {}). Exception: Port mapping for container 11fd19cb8765cff8effcb3dac33c31bad52c2e5abe7cb5be8c7a5db6c18e73cf and port 1521 is not available

I suspect something went wrong under the covers with spinning up the container altogether, given the Exception: Port mapping for container. I'm not sure what else I'm supposed to do here as I think setting a different timeout won't solve this particular issue (given that it says it used the default 120s), or did I get something wrong here?

gvenzl avatar Jun 13 '23 16:06 gvenzl

Hey @tillahoffmann, just wanted to check in on that one and see how you want to proceed.

Thx,

gvenzl avatar Jul 05 '23 22:07 gvenzl

Hey @tillahoffmann,

I've cleared the merge conflict and pumped up the oracledb driver version. Could you please approve the workflows?

gvenzl avatar Sep 13 '23 03:09 gvenzl

following! Is there any update on this? thanks!

thuyng-ing avatar Jan 25 '24 11:01 thuyng-ing

did some exploratory work here - https://github.com/testcontainers/testcontainers-python/compare/main...alexanderankin:testcontainers-python:gvenzl_main

alexanderankin avatar Mar 07 '24 05:03 alexanderankin

the original pull request which was opened last june had a hidden feature, which was a merged PR, which was also separately merged into testcontainers-python. additionally, there are several commits dealing only with setup.py and other removed files, which made for an interesting rebase. lastly, i removed the option to start it with a random password as that is unusable (youd have to open the logs and get the password out of there. at any rate, the oracle module is up to date again!

alexanderankin avatar Mar 31 '24 06:03 alexanderankin

the original commits are here for reference - https://github.com/testcontainers/testcontainers-python/commits/gvenzl/oracle-free

alexanderankin avatar Mar 31 '24 06:03 alexanderankin

Thanks a lot for merging this, @alexanderankin!

gvenzl avatar Apr 02 '24 15:04 gvenzl

@gvenzl thank you for your contribution!

alexanderankin avatar Apr 06 '24 11:04 alexanderankin