-
Notifications
You must be signed in to change notification settings - Fork 0
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
Schwannden Kuo
committed
Jul 20, 2022
1 parent
63c8138
commit 8442e74
Showing
4 changed files
with
12 additions
and
21 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
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 |
---|---|---|
@@ -1,33 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
function run_minio_server() { | ||
if [ ! -f tests/minio ]; then | ||
wget --quiet --output-document tests/minio https://dl.min.io/server/minio/release/linux-amd64/minio | ||
chmod +x tests/minio | ||
fi | ||
|
||
export MINIO_ACCESS_KEY=minio | ||
export MINIO_SECRET_KEY=minio123 | ||
export MINIO_ADDRESS=0.0.0.0:9002 | ||
tests/minio server /tmp/fs --address $MINIO_ADDRESS >tests/minio.log 2>&1 & | ||
} | ||
|
||
function run_mongo() { | ||
docker run --name awesome-mongo --rm -p 27000:27017 -d mongo:4.4.10 | ||
} | ||
|
||
if [ -z ${SERVER_ENDPOINT+x} ]; then | ||
run_minio_server | ||
MINIO_PID=$! | ||
trap 'kill -9 ${MINIO_PID} 2>/dev/null' INT | ||
trap 'docker rm -f awesome-mongo' INT | ||
run_mongo | ||
fi | ||
|
||
export MONGODB_DNS=mongodb://localhost:27000/beanie_db | ||
pytest --cov=awesome_sso tests --cov-report term-missing | ||
if [ -n "$MINIO_PID" ]; then | ||
kill -9 "$MINIO_PID" 2>/dev/null | ||
docker rm -f awesome-mongo | ||
fi | ||
docker rm -f awesome-mongo | ||
|
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