Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To test the frontend and the backend together, this change adds a new Travis job "Integration Tests".
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /bin/bash | ||
set -euo pipefail | ||
|
||
./script/init-local-index.sh | ||
|
||
# The below are required environment variables | ||
export SESSION_KEY=badkeyabcdefghijklmnopqrstuvwxyzabcdef | ||
export GIT_REPO_CHECKOUT=./tmp/index-co | ||
export GIT_REPO_URL=file://./tmp/index-bare | ||
export GH_CLIENT_ID= | ||
export GH_CLIENT_SECRET= | ||
|
||
./target/debug/server > backend.log & | ||
|
||
sleep 10 | ||
cat backend.log | ||
|
||
npm run start -- --proxy http://localhost:8888 > frontend.log & | ||
|
||
for i in $(seq 1 10) | ||
do | ||
set +e | ||
curl -H 'Accept: text/html' http://localhost:4200 | ||
case $? in | ||
0) | ||
break | ||
;; | ||
7) | ||
# Connection refused | ||
sleep 10 | ||
;; | ||
56) | ||
# Connection reset by peer | ||
sleep 10 | ||
;; | ||
56) | ||
# Connection reset by peer | ||
sleep 10 | ||
;; | ||
*) | ||
exit $? | ||
esac | ||
set -e | ||
done | ||
|
||
cat frontend.log |