Search code examples
mavenjunitopenshiftfabric8

Reset database container on openshift


I have a multi-modules vertx application deployed on OpenShift. For integration testing purposes, I would like to deploy a database container with pre-defined data, and destroy it when the test is finished.

How can I achieve this ?

My application uses junit and maven fabric8 plugin to deploy containers in Openshift.


Solution

  • This is something that could be done relatively easy using arquillian-cube, which does support Kubernetes and Openshift.

    What arquillian-cube can do for you, is to (optionally) create an ephemeral project, deploy everything you need for your test and once everything is up and running, then start your tests. In the end it can also do the cleaning up for you.

    It is quite flexible so according to your needs and requirements it can work with either ephemeral or fixed projects. And also there are pletny of configuration options when it comes to cleaning up.

    Last but not least, it does play quite nicely with the fabric8 maven plugin.

    https://github.com/arquillian/arquillian-cube/blob/master/docs/kubernetes.adoc