Skip to content

Commit

Permalink
Improve run_pytest.sh (#648)
Browse files Browse the repository at this point in the history
* Add shebang using bash shell
* Install all test requirements
* Fix broken visdom check
* If the script starts visdom, make sure to kill it after testing

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
  • Loading branch information
sloretz committed Dec 20, 2021
1 parent 26d29a6 commit 0d08112
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions run_pytest.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
pip install pytest boto3 moto onnx tensorboard matplotlib flake8==3.8.3
#!/bin/bash

if [ `ps|grep visdom |wc -l` = "1" ]
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

pip install -r $SCRIPT_DIR/test-requirements.txt

if [ `ps -ef|grep visdom |wc -l` = "1" ]
then
echo `ps|grep visdom |wc -l`
echo "no visdom"
visdom &
# kill visdom when done testing
trap "kill -SIGTERM $!" EXIT
fi

PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python pytest

0 comments on commit 0d08112

Please sign in to comment.