-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
36 lines (30 loc) · 912 Bytes
/
Copy pathtest.sh
File metadata and controls
36 lines (30 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
fails=""
inspect() {
if [ $1 -ne 0 ]; then
fails="${fails} $2"
fi
}
# run unit and integration tests
docker-compose -f docker-compose-dev.yml up -d --build
docker-compose -f docker-compose-dev.yml exec users python manage.py test
inspect $? users
docker-compose -f docker-compose-dev.yml exec users flake8 project
inspect $? users-lint
docker-compose -f docker-compose-dev.yml exec client npm test -- --coverage
inspect $? client
docker-compose -f docker-compose-dev.yml down
# run e2e tests
docker-compose -f docker-compose-prod.yml up -d --build
docker-compose -f docker-compose-prod.yml exec users python manage.py recreate_db
./node_modules/.bin/cypress run --config baseUrl=http://localhost
inspect $? e2e
docker-compose -f docker-compose-prod.yml down
# return proper code
if [ -n "${fails}" ]; then
echo "Tests failed: ${fails}"
exit 1
else
echo "Tests passed!"
exit 0
fi