#! /bin/sh
set -xe
origin="$PWD"

# Set up virtualenv
if [ -d rollerbot_venv ]; then
    rm -rf rollerbot_venv
fi

virtualenv -p python3.6 rollerbot_venv
. rollerbot_venv/bin/activate
python -m pip install -r firmware/validation/rollerbot/requirements.txt

# DBC files are generated by the make_dbcs fixture defined in the dbc_builder.py plugin.

# Run Smoke Test
python -m pytest firmware/validation/rollerbot/test_deploy.py \
                 --verbose

# Cleanup Bazel resources
bazel clean --expunge  # also shuts down bazel server
