-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add automation script to test backends
- Loading branch information
1 parent
277dad9
commit 16326c2
Showing
15 changed files
with
160 additions
and
35 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,10 @@ | ||
#!/bin/sh | ||
|
||
echo 'Getting dependencies...' | ||
dart pub get | ||
|
||
echo 'Activating conduit' | ||
dart pub global activate conduit | ||
|
||
echo 'Running conduit' | ||
conduit serve -a 127.0.0.1 -p 8080 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
echo 'Getting dependencies...' | ||
dart pub get | ||
|
||
echo 'Activating Minerva...' | ||
dart pub global activate minerva | ||
|
||
echo 'Running Minerva...' | ||
minerva run |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
#!/bin/sh | ||
|
||
echo 'Getting dependencies...' | ||
dart pub get | ||
|
||
echo 'Running server...' | ||
dart bin/server.dart |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
#!/bin/sh | ||
|
||
echo 'Getting dependencies...' | ||
npm install | ||
|
||
echo 'Running server...' | ||
npm start |
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
backends/py_flask/setup.sh → backends/py_flask/run.sh
100644 → 100755
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,4 +1,7 @@ | ||
#!bin/sh | ||
#!/bin/sh | ||
|
||
echo 'Getting dependencies...' | ||
pip install -r requirements.txt | ||
|
||
echo 'Running server...' | ||
python serve.py |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
# Conventional directory for build output. | ||
build/ | ||
results/ |
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,81 @@ | ||
#!/bin/sh | ||
|
||
set -eu; | ||
|
||
# Set up dart pub environment | ||
export PATH="$PATH":"$HOME/.pub-cache/bin"; | ||
|
||
( | ||
cd "benchmark"; | ||
dart pub get; | ||
) | ||
|
||
cd "$(dirname "$0")"; | ||
|
||
TEST_BACKENDS=$(ls backends); | ||
if [ "$#" -gt 0 ]; then | ||
TEST_BACKENDS="$*"; | ||
fi | ||
|
||
for backend in ${TEST_BACKENDS}; do | ||
if [ "${backend}" = "dart_conduit" ]; then | ||
echo "skipping ${backend} due to issues"; | ||
continue; | ||
fi | ||
|
||
echo "testing ${backend}"; | ||
|
||
( | ||
cd "backends/${backend}"; | ||
chmod +x ./run.sh; | ||
./run.sh; | ||
) | sed "s/^/ /" & | ||
|
||
# wait for server to start | ||
while ! curl -q "http://127.0.0.1:8080" > /dev/null 2>&1; do | ||
sleep 3; | ||
done | ||
|
||
# run tests | ||
echo "running tests - ${backend}"; | ||
( | ||
cd "benchmark"; | ||
dart run benchmark ${backend}; | ||
) | ||
|
||
# kill children processes | ||
echo "killing ${backend} process"; | ||
children_pids=""; | ||
for pid in /proc/*; do | ||
case "${pid}" in | ||
/proc/*[!0-9]* | "/proc/$$") | ||
continue; | ||
;; | ||
*) | ||
if grep -P "^\d+ \(.*\) [RSDZTW] \d+ $$ " "${pid}/stat" > /dev/null; then | ||
children_pids="${children_pids} ${pid#/proc/}"; | ||
fi | ||
;; | ||
esac | ||
done | ||
|
||
children_running="true"; | ||
while [ "${children_running}" = "true" ]; do | ||
children_running="false"; | ||
for pid in ${children_pids}; do | ||
if ps -p "${pid}" > /dev/null; then | ||
children_running="true"; | ||
echo "killing ${backend} with pid ${pid}"; | ||
kill "${pid}"; | ||
fi | ||
done | ||
|
||
sleep 1; | ||
done | ||
|
||
# wait for server to stop | ||
# while curl -q "http://127.0.0.1:8080" > /dev/null 2>&1; do | ||
# sleep 3; | ||
# done | ||
echo; | ||
done |