orma / openroads-api

The OpenRoads API
0 stars 0 forks source link

[WIP] Feature/docker tests #94

Closed kamicut closed 8 years ago

kamicut commented 8 years ago

Tests using docker-compose

olafveerman commented 8 years ago

Fixes

olafveerman commented 8 years ago

This looks great @kamicut :dancers:

@danielfdsilva Could you TMD on Monday morning? That way we start the week fresh with a new test setup. The following would be important to review:

@dereklieu If you're blocked before then, feel free to test as well.

danielfdsilva commented 8 years ago

Was able to follow the readme and setup docker. The setup worked and the tests passed.

However, there are some things I don't understand, maybe because of my lack of knowledge about how docker actually works.

kamicut commented 8 years ago

@danielfdsilva

  1. I made a mistake in docker-start and forgot to add a build command before it in the package.json. This should incorporate your changes
  2. Are you asking how to connect the local app without containerizing it?
  3. the npm run docker-test is a convenience method to run the whole test suite by creating a new empty db from scratch, booting it and running everything against it. To run a db on its own you can run docker-compose up [-d] postgres which will start the database on its own at $DOCKER_HOST:5433 and shut it down with docker-compose down && docker-compose rm -f. The latter command removes the container so that it doesn't pollute the next build.
danielfdsilva commented 8 years ago

1) Does this mean that every time there's a change I need to restart docker? 3) Ok. sounds simple enough. Will try.

kamicut commented 8 years ago

@danielfdsilva Yes if you want to recreate the run environment. However one idea could be to just run the DB and use your local.js to connect to it. This would probably be faster iteration, and we can reserve docker-start for deployment.

olafveerman commented 8 years ago

@danielfdsilva Made some changes to the readme. Can you check if it reads well?

Regarding 1), you're correct, but @kamicut just realized it might be faster to spin up the DB using docker compose-up...' and run the API usingnpm start`

danielfdsilva commented 8 years ago

@olafveerman @kamicut All seem clear on the readme. Two things:

olafveerman commented 8 years ago

@danielfdsilva @kamicut npm run for the db added, plus fleshed out the README a bit more.

danielfdsilva commented 8 years ago

:+1: go flight