Skip to content

Commit

Permalink
Makefile: Add make targets for test (#3032)
Browse files Browse the repository at this point in the history
  • Loading branch information
koooge authored and arikfr committed Nov 12, 2018
1 parent 46363cc commit c2bd851
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -3,7 +3,7 @@ version: 2.0
flake8-steps: &steps
- checkout
- run: sudo pip install flake8
- run: ./flake8_tests.sh
- run: ./bin/flake8_tests.sh
jobs:
python-flake8-tests:
docker:
Expand Down
27 changes: 25 additions & 2 deletions Makefile
@@ -1,23 +1,46 @@
.PHONY: compose_build test_db create_database clean bundle tests build watch start
.PHONY: compose_build up test_db create_database clean down bundle tests lint backend-unit-tests frontend-unit-tests test build watch start

compose_build:
docker-compose build

up:
docker-compose up -d --build

test_db:
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"
@for i in `seq 1 5`; do \
if (docker-compose exec postgres sh -c 'psql -U postgres -c "select 1;"' 2>&1 > /dev/null) then break; \
else echo "postgres initializing..."; sleep 5; fi \
done
docker-compose exec postgres sh -c 'psql -U postgres -c "drop database if exists tests;" && psql -U postgres -c "create database tests;"'

create_database:
docker-compose run server create_db

clean:
docker ps -a -q | xargs docker kill;docker ps -a -q | xargs docker rm

down:
docker-compose down

bundle:
docker-compose run server bin/bundle-extensions

tests:
docker-compose run server tests

lint:
./bin/flake8_tests.sh

backend-unit-tests: up test_db
docker-compose run --rm --name tests server tests

frontend-unit-tests: bundle
npm install
npm run bundle
npm test

test: lint backend-unit-tests frontend-unit-tests

build: bundle
npm run build

Expand Down
File renamed without changes.

0 comments on commit c2bd851

Please sign in to comment.