How to setup Unit Tests for your Services

Runnable makes it easy to setup testing for your services using Compose.

Configuring your unit tests

Let’s walkthrough configuring an example repository. The repository we will configure has the following Docker compose file: From this Compose file, it is clear that we expect to see 2 containers launch for this repository: a web container and a db container. To configure this repository on Runnable,

  1. Go to your org on the

  2. Click on the “Add Services” button and select the repository where the Compose file is tracked Add Repository

  3. You will now see the configuration modal with the ‘Compose’ tab selected. Here you can name your service, etc. Configure Service

  4. To configure a testing environment, ensure that the testing is toggled on. Enable Testing

  5. Specify the path of the Docker Compose file in the repository. The path should be relative to the root of the repo. Specify Docker-Compose Path

  6. Next, select the service that you will be running tests from. Github integration will be applied to this service. Select Test Container

  7. Click on “Create Environment”. GitHub Organization People

  8. Your testing services will now build and deploy. You will be able to see the test results using the status icon to the left of the service name. GitHub Organization People

  9. Check the CMD tab to see the logs from your unit tests. GitHub Organization People