0

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.

Khanetor
  • 11,595
  • 8
  • 40
  • 76
  • My first thought when seeing this is "What does localhost refer to in the context that you're running this?". If you're running this on Codeship, you're probably executing your build inside a Docker container, and it's unlikely that your database is also installed in that Docker container. – Josh Padnick Jun 28 '15 at 18:52
  • Codeship does not use Docker. When I look at the Rails and Python instruction, I saw that they use localhost as host. – Khanetor Jun 29 '15 at 01:19
  • Ahoy, Marko from the Codeship crew speaking. From a first look the configuration looks fine. Could you open an in app support request with a link to your project so we can take a look at the log output? Thx! – mlocher Jun 29 '15 at 04:34

1 Answers1

1

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

Khanetor
  • 11,595
  • 8
  • 40
  • 76