Running Django Tests in Oracle

Hi. I have a project that currently supports Postgres, MySQL and Oracle. We have our Django tests running via pytest, and they currently work fine on MySQL and Postgres. We’ve spent days trying to get the tests to run in an automated manner in Oracle and have not managed to get it working.

The only way we’ve managed to get the tests working is using the Oracle VirtualBox VM as mentioned here. This is not viable as a CI/CD action.

Is there a canonical answer to getting Django tests running against an Oracle Docker image? I’m happy to accept licensing terms etc from Oracle Inc, but I just cannot find a way of getting it to work. It seems like the main issue is around permissions and the tests trying to create a database.

Thanks!
Ben

Just to follow up - I’m happy to sponsor this work if we can get it running in a hands-off environment!

Hi,

You can try to use a docker image from the Oracle containers repository. It contains a single pluggable database with an access to the SYS user so you should be able to create a main user with DBA privileges, as described in:

https://code.djangoproject.com/wiki/OracleTestSetup

Best,
Mariusz

1 Like

Is there a way of doing this inside a CI/CD action?

It should be doable. You can run SQL scripts via sqlplus, see a similar scripts where we set up PostgreSQL database via psql for GitHub actions.

Thanks @felixxm will take a look.

Is there anywhere that this happens in a CICD action as part of Django as a whole? How do tests run against Oracle during core platform development?

No, an instance is set up in advance.

We have a separate server with Oracle DB used by https://djangoci.com.