Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-6028

Add Ability to run Integration Tests on MySQL and PostgreSQL Using TestContainers

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      Our existing tests run on an in memory h2 database. Which is good because it is simple to set up and the tests run fast.

       We need to integrate these exact same tests with MySQL and PostgreSQL (the databases that we currently support) to expose failures that H2 would not ,since H2 doesnt give 100%  compatibility with MySQL or PostgreSQL .

      One Approach would be to use TestContainers ,a Java library that provides and manages lightweight docker instances of common databases.

      This will require adding configuration for MySQL and PostgreSQL here 

      we can set a System Property ie 

      testDb=mysql/postgresql

      to be able to switch between the different databases when running the test. 

      we can provide the default as `testDb=mysql `  but this can be overriden  via the commandline when running tests  ie

      mvn test -DtestDb=mysql

      or 

      mvn test -DtestDb=postgresql

       see more on the talk thread 

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              sharif Sharif Magembe
              Reporter:
              mozzy Moses Mutesasira
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: