-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Robertson
committed
Aug 18, 2023
1 parent
abff8b9
commit 4825f2d
Showing
2 changed files
with
64 additions
and
39 deletions.
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,25 @@ | ||
#!/bin/bash -eu | ||
export SYNCV3_BINDADDR=0.0.0.0:8844 | ||
export SYNCV3_ADDR='http://localhost:8844' | ||
export SYNCV3_DEBUG=1 | ||
|
||
# Run synapse and stop it afterwards. | ||
python -m synapse.app.homeserver -c synapse/homeserver.yaml & | ||
SYNAPSE_PID=$! | ||
|
||
# Run the binary and stop it afterwards. | ||
# Direct stderr into stdout, and optionally redirect both to a file. | ||
../syncv3 &> "${E2E_TEST_SERVER_STDOUT:-/dev/stdout}" & | ||
SYNCV3_PID=$! | ||
trap "kill $SYNCV3_PID; kill $SYNAPSE_PID" EXIT | ||
|
||
# wait for the server to be listening, we want this endpoint to 404 instead of connrefused | ||
until [ \ | ||
"$(curl -s -w '%{http_code}' -o /dev/null "http://localhost:8844/idonotexist")" \ | ||
-eq 404 ] | ||
do | ||
echo 'Waiting for server to start...' | ||
sleep 1 | ||
done | ||
|
||
go test "$@" |