-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added query caching * style: applied prettier * fix: fixed caching * test: improved test script to not start a testing server if one is already running * fix: fixed caching further, improved test * fix: added comments about query caching * fix: don't cache empty results, added test
- Loading branch information
Showing
3 changed files
with
165 additions
and
27 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,15 +1,24 @@ | ||
#!/bin/bash | ||
aw-server --testing --storage=memory &> /dev/null & | ||
AWPID=$! | ||
|
||
# Give aw-server some time to start | ||
sleep 5 | ||
# if something is already running on port 5666, assume server already running | ||
if lsof -Pi :5666 -sTCP:LISTEN -t >/dev/null ; then | ||
echo "aw-server already running on port 5666" | ||
else | ||
SERVER_STARTED=1 | ||
aw-server --testing --storage=memory &> /dev/null & | ||
AWPID=$! | ||
|
||
# Give aw-server some time to start | ||
sleep 5 | ||
fi | ||
|
||
# Run tests | ||
mocha ./out/test/*.js | ||
EXITCODE=$? | ||
|
||
# Shutdown AW | ||
kill $AWPID | ||
if [ $SERVER_STARTED ]; then | ||
# Shutdown AW | ||
kill $AWPID | ||
fi | ||
|
||
exit $EXITCODE |