-
Notifications
You must be signed in to change notification settings - Fork 75
37 lines (35 loc) · 1.27 KB
/
test-integration.yml
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
37
name: "Node Integration Tests"
# run this on a pull request for testing
on:
pull_request:
# use a single job at first
jobs:
run-integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build and Run Services and Mongo Containers
run: |
cp docker/.docker-env.test-example docker/.docker-env
docker compose --file docker/docker-compose.yml build
docker compose --file docker/docker-compose.yml up -d
- name: Sleep
run: |
dockercompose="docker compose --file docker/docker-compose.yml"
attempts=60
while ! $dockercompose logs cveawg | grep -q 'Serving on port'; do
attempts=$(expr $attempts - 1)
if [ $($dockercompose ps --status running -q | wc -l) -eq 2 ] && [ $attempts -gt 0 ]; then
sleep 1
$dockercompose logs || true
continue
fi
$dockercompose ps || true
$dockercompose logs || true
echo "==== COULD NOT FIND 'Serving on port' in cveawg output OR one of the services died ====" 1>&2
exit 1
done
- name: Run Tests
run: docker compose -f docker/docker-compose.yml exec -T cveawg npm run test:integration
continue-on-error: false