Locally Testing Your Work in Oracle Databases
Suraiya Khan
Technology Leadership and Consultation; Transformation Coaching; Student of "Love or Above" (Dr. David R. Hawkins)
I have been seeing companies are having issues due to limited instances of Oracle databases. With a single database instance for DEV environment it becomes very hard for developers to coordinate work and test effectively without getting on each other's toes. But what if we could set a local database instance using docker containers? The container would have database setup and tear down every time we need to test. We do not need data persistence in this case.
For PostGreSQL databse related testing pgTAP (https://github.com/theory/pgtap) is well known.
However equivalent work in Oracle (https://docs.oracle.com/cd/E88353_01/html/E37842/tap--parser-3.html) is not that common.
Here is a basic https://github.com/NovaVic/plTAP/tree/master repo that I am working on. This is a fork from jwovens/plTAP repo. Last weekend I adapted jwovens docker file example from Oracle 11 to Oracle 21. For other versions of Oracle have a look at (https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance/dockerfiles and https://hub.docker.com/r/gvenzl/oracle-xe)
I added basic table creation, sql look up and test example.I have yet to add package testing. That would be very similar to what jwovens already has anyway like https://github.com/NovaVic/plTAP/blob/master/sqlplus/sqlplus_example.sql#L98 .
For this to work for your project you have to add business rules. In my in progress work (fake) business rules are getting added to this file https://github.com/NovaVic/plTAP/blob/master/sqlplus/sqlplus_example.sql .
领英推荐
Why is it important?
Lot of compnies and public sector organizations are handling Oracle Forms Modernization. This is because Oracle Forms are reaching end of life and support. There are business rules which should go from the Forms back to the database. During the modernization process streamlining automated testing / having failure feedback early and often is critical.
That's all for today.
Note: One of my next writings would be on local setup and testing of Oracle Rest Data Services (ORDS). Many businesses expose the databases via API using ORDS. And there are similar challenges for DEV testing due to limited instances of ORDS.
Impressive insights on leveraging Docker for Oracle database testing—streamlining the DEV environment setup could indeed mitigate instance limitations and enhance testing efficiency!