mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Makefile: Add make targets for test (#3032)
This commit is contained in:
@@ -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:
|
||||
|
||||
27
Makefile
27
Makefile
@@ -1,10 +1,17 @@
|
||||
.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
|
||||
@@ -12,12 +19,28 @@ create_database:
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user