We'll cover the following
Step-1: Setting up the database
Step-2: Executing the tests
Until this point, we have only looked at the code and have not executed the tests themselves. Let’s do that now.
To execute the tests, click on the Run button and wait for the environment to set up. We pull a docker image with the pre-configured environment to save you the hassle of setting up the environment on your own.
Once set up, you will need to perform the following two steps:
Step-1: Setting up the database
First, we need to start the PostgreSQL database within the container. We can do that by using the following command:
1
service postgresql start
Start PostgreSQL
Step-2: Executing the tests#
Once the database is up, we can use the following command to execute all the tests:
1
sbt test
sbt test