Is there much work left with testing openmrs with mariadb? @cintiadr@raff@burke@lluismf. I’ll like to get a heads up on settings the tests on docker and running. I’ll have some time in the next few weeks after my GSoC project. So I can push some work in this direction.
I’m getting the following logs when starting openmrs:
2015-08-23 09:05:40.860:INFO:oejs.Server:main: jetty-9.0.4.v20130625
2015-08-23
09:05:46.490:INFO:oejpw.PlusConfiguration:main: No Transaction manager
found - if your webapp requires one, please configure one.
2015-08-23 09:06:03.136:INFO:/openmrs:main: No Spring WebApplicationInitializer types detected on classpath
2015-08-23 09:06:07.204:INFO:/openmrs:main: Set web app root system property: 'webapp.root' = [/root/openmrs/47/tmp/webapp]
2015-08-23 09:06:07.207:INFO:/openmrs:main: Initializing log4j from [classpath:log4j.xml]
WARN
- OpenmrsUtil.getRuntimePropertiesFilePathName(2669) |2015-08-23
09:06:07,320| Unable to find a runtime properties file at
/openmrs-runtime.properties
WARN -
OpenmrsUtil.getRuntimePropertiesFilePathName(2697) |2015-08-23
09:06:07,330| Unable to find properties file:
/root/openmrs/47/openmrs-runtime.properties
WARN -
OpenmrsUtil.getRuntimeProperties(2630) |2015-08-23 09:06:07,330| Unable
to find a runtime properties file. Initial setup is needed. View the
webapp to run the setup wizard.
WARN -
OpenmrsUtil.getRuntimePropertiesFilePathName(2669) |2015-08-23
09:06:07,629| Unable to find a runtime properties file at
/openmrs-runtime.properties
WARN -
OpenmrsUtil.getRuntimePropertiesFilePathName(2697) |2015-08-23
09:06:07,630| Unable to find properties file:
/root/openmrs/47/openmrs-runtime.properties
WARN -
OpenmrsUtil.getRuntimeProperties(2630) |2015-08-23 09:06:07,630| Unable
to find a runtime properties file. Initial setup is needed. View the
webapp to run the setup wizard.
2015-08-23
09:06:07.650:INFO:oejsh.ContextHandler:main: Started
o.e.j.m.p.JettyWebAppContext@54bbc891{/openmrs,file:/root/openmrs/47/tmp/webapp/,AVAILABLE}{/root/openmrs/47/openmrs-1.11.2.war}
2015-08-23 09:06:07.678:INFO:oejs.ServerConnector:main: Started ServerConnector@7fedeca9{HTTP/1.1}{0.0.0.0:8080}
Some other heaps of improvements that need to be done:
move those files to a git repository instead of being on the build
making sure docker containers are removed after finishing
make the start up script a little bit more robust! Upgrading Bamboo would be useful
mariadb doesn’t need to expose a port to the host
retrieve the application logs even after the container finished, and on the build itself ( I have no idea where they are, or are we talking here about only the maven jetty one?)
also, set up the real tests. I exported the port 8080 to the host too, but as we have 2 build agents on the same server, I suppose we can set anything else.
If someone could please help, it would be much appreciated!
move those files to a git repository instead of being on the build
making sure docker containers are removed after finishing
make the start up script a little bit more robust! Upgrading Bamboo would
be useful
mariadb doesn’t need to expose a port to the host
retrieve the application logs even after the container finished, and on
the build itself ( I have no idea where they are, or are we talking here
about only the maven jetty one?)
also, set up the real tests. I exported the port 8080 to the host too,
but as we have 2 build agents on the same server, I suppose we can set
anything else.
Am I to set these tests up on my local host or Am I to use the OpenMRS CI site. If it’s on my localhost I’ve not installed docker on my system, which I’ll have to do.
If you want to run locally, you don’t need to have docker installed. You can install MariaDB locally and then use it. @cintiadr chose to use docker in CI because it is easy to install and easy to drop. Of course you can install docker in your local environment if you want, but it is up to you. It is not required at all.
@darius@raff@burke it was already one month that @cintiadr and I have configured the bamboo build. Have you tested this at all? Is this still important?
I ran the tests you configured on bamboo some few weeks back and the results were successful, So I just wanted to know what I should expect while running OpenMRS 2.2 on mariaDb locally. I’m guessing there’s probably not much testing left for this. I’ll contact @dkayiwa and hear what he says.
I am not sure if you did run the tests I am talking about. The latest build
is from August 23th, exactly the same day that @cintiadr and I configured
the build.
And still no feedback at all. I am starting to wonder if this was useful…
I changed BaseContextSensitiveTest in order to use a memory DB depending on a system property. The property is useInMemoryDatabase. If it doesn’t exist or is true, it uses the H2 database. If it’s false, uses the DB configured in the openmrs-runtime.properties file.
Unless in the memory case, the DB is not initialized and no test data is inserted (see initializeInMemoryDatabase method). Therefore the DB must be already initialized (all tables created, and a few of them with data) and the properties file should point at it.
Is that for the MariaDB docker tests on CI? I ran the tests some few days ago and got no failed tests. So If you made some updates I’ll re-run the tests and see.
This thread is long (and I’m not going to go back and read it all), so let’s take a step back:
Our goal for the upcoming OpenMRS release is to commit to support for MariaDB, in addition to MySQL. The way we intend to do this is to have a regularly-running CI plan testing OpenMRS against MariaDB.
My suggestion had been that we run our functional tests against a MariaDB back end (in addition to the MySQL one we’re already testing against). Lluis had proposed that we run the context-sensitive tests in the usual build against MariaDB on CI (instead of H2).
So, help me understand where we’re at now, and let’s try to gather the current status here:
I think that Cintia and Mario configured CI so that you can run the functional tests against MariaDB in a docker container. Is that true? And what’s the URL of that CI plan?
I gather from people’s comments that this plan is not running automatically. Correct? If not, is there some reason we haven’t set it up yet?
Per Lluis’s post, we can run context-sensitive tests against MariaDB. But we are not doing this yet, correct?
Cintia, Mario, would it be easy to use the same MariaDB docker container in a new openmrs-core “build against mariadb” plan?
We should have CI plans that run the context sensitive tests against h2, MariaDB and MySQL(we historically skipped this). I believe the UI tests need to be run against just one DB and not all because if they are testing functionality that hits the DB, most likely that was already covered by the context sensitive tests in the platform
Context sensitive tests means unit tests? If so, I did a small change but was reverted due to line endings problems. The idea is to use a system property to specify wich kind of DB use in testing.
I don’t know about these context-sensitive tests. Currently the CI plan starts two dockers, one with openmrs running on 8080 and another one with running MariaDB. Both docker containers are already connected, which means there is a OpenMRS instance connected with MariaDB using docker containers.
1) I don’t see why not
2) We probably won’t have time available to work on this until the end of year, so it is up to you.
@lluismf context sensitive tests in OpenMRS are technically not really unit tests but rather more like integration tests. That system property shouldn’t never be required by pure unit tests
I was asked to try out OpenMRS as an EMR for our project. The thing is, we have a CentOS 7.3 on our server with MariaDB. I’ve looked through documentation and messages here, some people reported they had made openmrs work with mariadb. Unfortunately, it didn’t work for me.
So here are few lines how I finally started it up. At first, installation wizard couldn’t connect to the database. MariaDB has its own driver, so I just downloaded it, placed it to /openmrs/WEB-INF/lib/ folder and set a classpath. And really, connection errror log didn’t lie, it should really be stored in that particular folder.
echo $CLASSPATH
/opt/tomcat/webapps/openmrs/WEB-INF/lib/mariadb-java-client-2.2.0.jar
Connection string was changed from jdbc:mysql: to jdbc:mariadb:. These steps got me through right to tables creation. It failed immediately with some syntax errors. So I had to get some Java IDE and look at code. Managed to trace sql queries code, there was a line replacing single quotes with slashes. That really is not necessary for mariadb, so I changed if-statement.