Supporting MariaDB with OpenMRS 2.3 release?

@tharunya There was task pending that Nyah Check took instead of me IIRC. I will take a look at the code this week-end.

1 Like

Sure @cintiadr , Seems like help is already on the way :slight_smile: Glad that @ch3ck volunteered to take it up :smiley:

Hopefully, things will go smooth.

1 Like

@lluismf,

I’m searching for the link to the tests setup on OpenMRS bamboo, I can’t seem to find the link. I ran some of these tests previously some weeks ago. But will like do some final tests before we can conclude. I’ve ran the OpenMRS v2.2 on my localhost which has mariaDB setup and I can’t find any problems so far.

Cheers!

1 Like

We (myself, @darius, @wyclif, @dkayiwa) discussed this on today’s design forum. I’ve tried to lay these out in order.

Ideally, these tests would be run on separate “worker” machines (not directly on CI), so we can trigger these with each commit:

  1. Create a CI plan to build openmrs-core against MySQL, failing if build fails.
  2. Create a CI plan to build openmrs-core against MariaDB, failing if build fails.
  3. Make sure MySQL plan runs integration tests, failing if tests fail
  4. Make sure MariaDB plan runs integration tests, failing if tests fail
  5. Enhance MySQL plan to do first-time setup of reference application, failing if setup fails
  6. Enhance MariaDB plan to do first-time setup of reference application, failing if setup fails
  7. Enhance MySQL plan to run refapp integration tests
  8. Enhance MariaDB plan to run refapp integration tests

Presumably, we can leverage the Docker trickery that Lluis & Cintia worked out. We’re hoping we can get past step #2 by the end of this week.

How close are we along this sequence? @ch3ck do you have access to Bamboo (CI)? @dkayiwa can help.

More on this:

  • This should basically just mean doing a standard maven build of openmrs-core, with an environment variable set to point to an external database (instead of the in-memory H2 one)
  • Per Lluis’s comment at Support for MariaDB: Looking for volunteers we may need to reapply a commit to be able to run context-sensitive tests during the regular OpenMRS build against an external DB based on an environment variable
  • probably the easiest way to get a clean mariadb/mysql is to use the docker tricks that Cintia and Mario worked out. You may also need to use the openmrs sdk to create the structure of the database

Just to make sure to link it here:

That explains exactly the status of the MariaDB containers build

Hello @burke,

I have access to Bamboo. So I’m ready to work on running these tests to enhance MariaDB on OpenMRS.

Awesome! I think we want to have separate plans for MySQL and MariaDB, since (1) the list of databases will hopefully grow with time and, more importantly, (2) when there’s a db-specific failure we want to be very clear which platform was affected. If @cintiadr has a different recommendation, then I would listen to her and ignore me. :smiley:

First & foremost, we’d like to get to the point that we’re building/deploying openmrs-core (i.e., at least doing DB install scripts and ensuring they succeed) for both MySQL and MariaDB. That’s steps #1 and #2 above. I’m hoping/assuming our infrastructure is at a point where those builds can be farmed out to worker machines (not suck more cycles from the CI server). If we aren’t readily able to perform these builds on worker machine(s) – independent of CI – yet (@michael, @cintiadr, and/or @ryan should know the answer) and these plans are heavyweight (hopefully not, if we’re leveraging Docker containers), then we might have to compromise for the time being and run them on a schedule instead of after each commit. I’m hoping we can run the plans after each commit and, if not, we can get there very soon.

Please don’t hesitate to reach out for assistance if you need help or have questions. @dkayiwa has your back and we have lots of amazing people in the community that can help answer questions.

Cheers,

-Burke :burke:

1 Like

Alright, I think @dkayiwa and I can proceed with the first task, when moving on sequentially from there.

1 Like

I have created two CI build plans for MySQL and MariaDB. They are both using the default h2 DB. I 'll need some assistance in configuring a MariaDB DB on OpenMRS CI and having the MySQL plan use the configured MySQL db on Bamboo.

Thanks, Nyah

I’m very very confused. Sorry for the delay, I’m particularly busy these weeks.

I did create the MariaDB plan, it’s running mariadb and openmrs using the SDK. https://ci.openmrs.org/browse/RELEASE-MDT Both in docker. I’ve explained what I did in a comment before.

But it was still asking for some initial setup, I don’t know why. Someone needs to take a look why, not sure if it’s some configuration missing. From that, I need someone to setup the integration tests. It’s not the unit tests, I suppose the unit tests don’t touch the database.

The unit tests are using an in-memory H2 database. But if you want to have them use another database, you can use a couple of system properties like in the example below:

Looks like the sample system properties did not go through. Here we go again:

-DuseInMemoryDatabase=false
-DdatabaseUrl=jdbc:mysql://localhost:3306/openmrstest?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8
-DdatabaseUsername=test
-DdatabasePassword=test
-DdatabaseDriver=com.mysql.jdbc.Driver
-DdatabaseDialect=org.hibernate.dialect.MySQLDialect

@cintiadr how do i see the initial setup screen? Or did you eventually fix it?

I did not fix it, and I cannot even volunteer myself to fix it now, even if I had any knowledge of integration tests setup in openmrs.

I’m not entirely sure why unit tests would need to use a database, but maybe I understood it incorrectly. I was aiming to get integration/selenium tests running against the brand-new instance.

So, the build is starting openmrs and killing it after. So, every build is a new instance, and there’s no graphical mode on the agents. Even if they had, the build is cleaning up those instances.

There are quite a few options, for example, running the same docker containers locally (if using boot2docker in windows and mac, or simply docker in linux).

Other option is configure the build to do curl or wget on that page and grab any textual information you want.

@ch3ck, the idea is that you need to copy some of the stages that Cintia worked out here, which start up mariadb in a docker container, then run the tests, and then shut it down.

We don’t want to install mysql and mariadb on the bamboo agents for this, but rather use disposable docker containers for this.

@cintiadr, to address your confusion, we decided to first follow Lluis’s suggested plan (rather than mine) of switching things around so that the h2-backed integration tests that are part of the standard openmrs-core build are instead run against mariadb and mysql. These are JUnit tests, which is why people are referring to them as “unit tests” though this isn’t precise.

Oh, right, it makes sense :smile:

@darius,

Alright I see. Since I’m not familiar with docker; I"ll need some assistance from @dkayiwa in setting up the disposable containers to run the tests.

@cintiadr, I am having some issues properly setting up the OpenMRS docker image to run MySQL on docker. It’s like I’m not properly passing the system properties adequately. Could you help me out here?

@dkayiwa, How do I then pass the various tests, @burke recommends to Docker Image

Sure, please let me know the output of:

docker info

and also which command lines you are using.

1 Like