-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun-e2e-tests
executable file
·20 lines (14 loc) · 1.11 KB
/
run-e2e-tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# Copyright 2021 Adevinta
set -e
# build and run mock scheduler
cd cmd/test-tools/mockscheduler && go build && cd -
./cmd/test-tools/mockscheduler/mockscheduler &
# build API and run e2e tests
cd cmd/vulcan-api && go build && cd ../..
./cmd/vulcan-api/vulcan-api -c _resources/config/travis.toml &
token=$(cat _resources/config/testuser.token) && tokenuser1=$(cat _resources/config/testuser1.token) && tokenuser2=$(cat _resources/config/testuser2.token)
docker run -q --network=host -v "$PWD":/src postman/newman:alpine run /src/postman/vulcan.postman_collection.json -e /src/postman/vulcan.postman_environment.json --global-var token="$token" -r cli,junit --reporter-junit-export /src/build/reports/tests/newman.xml
docker run -q --network=host -v "$PWD":/src postman/newman:alpine run /src/postman/vulcan-authorization.postman_collection.json -e /src/postman/vulcan.postman_environment.json --global-var token="$token" --global-var tokenuser1="$tokenuser1" --global-var tokenuser2="$tokenuser2" -r cli,junit --reporter-junit-export /src/build/reports/tests/newman-auth.xml
pkill mockscheduler
pkill vulcan-api