-
Notifications
You must be signed in to change notification settings - Fork 17
/
dpc-portal-test.sh
executable file
·36 lines (30 loc) · 1.75 KB
/
dpc-portal-test.sh
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
set -e
function _finally {
docker compose -p start-v1-portals -f docker-compose.yml -f docker-compose.portals.yml down
docker volume rm start-v1-portals_pgdata16
}
trap _finally EXIT
echo "┌───────────────────────┐"
echo "│ │"
echo "│ Running Portal Tests |"
echo "│ │"
echo "└───────────────────────┘"
# Build the container
make portal
# Prepare the environment
docker compose -p start-v1-portals -f docker-compose.yml -f docker-compose.portals.yml up start_core_dependencies
docker compose -p start-v1-portals -f docker-compose.yml -f docker-compose.portals.yml run --entrypoint "bundle exec rails db:create db:migrate RAILS_ENV=test" dpc_portal
# Run the tests
echo "┌───────────────────────────┐"
echo "│ │"
echo "│ Running DPC Portal Tests │"
echo "│ │"
echo "└───────────────────────────┘"
docker compose -p start-v1-portals -f docker-compose.yml -f docker-compose.portals.yml run --entrypoint "bundle exec rubocop" dpc_portal
docker compose -p start-v1-portals -f docker-compose.yml -f docker-compose.portals.yml run --entrypoint "bundle exec rspec" dpc_portal
echo "┌────────────────────────────────┐"
echo "│ │"
echo "│ Portal Tests Complete │"
echo "│ │"
echo "└────────────────────────────────┘"