Play Framework run test in Codeship with database

356 views Asked by At

I need to run test for my Play app in Codeship. The problem is that my app cannot find the database to connect to, and this all tests are failing. From the doc, I suppose that there are 3 different Postgres DBs (9.2, 9.3, 9.4) that I can use, so I configure my conf as below.

enter image description here

enter image description here

Please let me know where I got it wrong.

1

There are 1 answers

0
Khanetor On BEST ANSWER

I finally found out why my test could not find the database. It was because running the test with sbt test -Dconfig.resource=test.application.conf is not a valid way to specify java option for test.

I have to go to the build.sbt file and add the following for test to load the correct config like illustrated below.

enter image description here