Skip to content

Commit

Permalink
Add ability to test individual or a subset of modules only
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-stubbs committed Aug 6, 2024
1 parent ec40875 commit a441dc8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bbot/test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ echo "======================="
flake8 --select F,E722 --ignore F403,F405,F541 --per-file-ignores="*/__init__.py:F401,F403" "$bbot_dir" || exit 1
echo

echo "[+] Testing with pytest"
pytest --exitfirst --disable-warnings --log-cli-level=ERROR "$bbot_dir" --cov=bbot/test/test_step_2/test_cli.py --cov-report="term-missing" --cov-config="$bbot_dir/test/coverage.cfg"
if [ "${1}x" != "x" ] ; then
MODULES=`echo ${1} | sed -e 's/,/ /g'`
for MODULE in ${MODULES} ; do
echo "[+] Testing ${MODULE} with pytest"
pytest --exitfirst --disable-warnings --log-cli-level=ERROR "$bbot_dir" --cov=bbot/test/test_step_2/test_cli.py --cov-report="term-missing" --cov-config="$bbot_dir/test/coverage.cfg" -k ${MODULE}
done
else
echo "[+] Testing all modules with pytest"
pytest --exitfirst --disable-warnings --log-cli-level=ERROR "$bbot_dir" --cov=bbot/test/test_step_2/test_cli.py --cov-report="term-missing" --cov-config="$bbot_dir/test/coverage.cfg"
fi

0 comments on commit a441dc8

Please sign in to comment.