Closed kamicut closed 8 years ago
Fixes
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.
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.
npm run docker-start
starts the api but it doesn't incorporate my local changes.npm run docker-test
? Or for development there's some way that doesn't involve booting a container every time. Also, is it possible to connect to the database used for the tests? Sometimes is useful for debug.@danielfdsilva
docker-start
and forgot to add a build command before it in the package.json. This should incorporate your changesnpm 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. 1) Does this mean that every time there's a change I need to restart docker? 3) Ok. sounds simple enough. Will try.
@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.
@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 using
npm start`
@olafveerman @kamicut All seem clear on the readme. Two things:
npm run
command also for the db container? That way all behave the same.@danielfdsilva @kamicut npm run
for the db added, plus fleshed out the README a bit more.
:+1: go flight
Tests using docker-compose