Tuesday 27 December 2016
docker - Running tests on circleci with depends_on on circleci
Answer
When having a docker-compose
setup using depends_on
for starting up a database and running migration before being able to run the tests.
How is the correct way to run the tests on circleci?
I've tried running docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm app
according to another stackoverflow issue. The issue is that then my migrations doesn't run and my tests fails accordingly
My working config.yml
looks like this, but do i have to run up
before being able to run run
when using depends_on
. When just running the second run
command my migration doesn't get called and my tests fails?
version: 2
jobs:
build:
machine: true
working_directory: ~/repo
steps:
- checkout
- run: docker-compose up -d
- run: docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm app
The important part of my docker-compose
is:
version: "3.2"
services:
app:
command: npm run start
build:
context: .
depends_on:
- migration
- postgres
Which is overriding the command
and volumes
in docker-compose.test.yml
I would like to be able to run my test on circleci
with one command, this is my first docker setup but i couldn't find any answers to this issue.
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
A fair amount of the second act of The Dark Knight Rises has a class warfare plotline. This is foreshadowed in the trailers with Selina Ky...
-
How can I detect either numbers or letters in a string? I am aware you use the ASCII codes, but what functions take advantage of the...
-
I want to create an options array from a string. How can i create an array as { width : 100, height : 200 } from a string ...
No comments:
Post a Comment