From a1dce6ef475c69e446ab1ce13f1aadb26092804c Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 26 Jul 2024 11:34:36 -0700 Subject: [PATCH] op.sh: run pytest (#33090) test --- tools/op.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/op.sh b/tools/op.sh index 55cc3d60d9..3dd375c960 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -255,6 +255,15 @@ function op_lint() { ) } +function op_test() { + (set -e + + op_before_cmd + op_run_command pytest $@ + + ) +} + function op_replay() { (set -e @@ -308,6 +317,7 @@ function op_default() { echo -e " ${BOLD}replay${NC} Run replay" echo -e " ${BOLD}cabana${NC} Run cabana" echo -e " ${BOLD}lint${NC} Run all the pre-commit checks" + echo -e " ${BOLD}test${NC} Run all unit tests from pytest" echo -e " ${BOLD}help${NC} Show this message" echo -e " ${BOLD}install${NC} Install the 'op' tool system wide" echo "" @@ -353,6 +363,7 @@ function _op() { juggle ) shift 1; op_juggle "$@" ;; cabana ) shift 1; op_cabana "$@" ;; lint ) shift 1; op_lint "$@" ;; + test ) shift 1; op_test "$@" ;; replay ) shift 1; op_replay "$@" ;; sim ) shift 1; op_sim "$@" ;; install ) shift 1; op_install "$@" ;; @@ -384,6 +395,7 @@ unset -f op_before_cmd unset -f op_sim unset -f op_activate_venv unset -f op_get_openpilot_dir +unset -f op_test unset DRY unset NC unset RED