Newer
Older
CNCTools / ReferenceSurfaceGenerator / backend / run_tests.sh
@yangyang xie yangyang xie 24 days ago 622 bytes add more logic
#!/bin/bash

# Exit immediately if a command exits with a non-zero status.
set -e

# Get the directory of the script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Activate the virtual environment
echo "[TEST_RUNNER] Activating Python virtual environment..."
source "$SCRIPT_DIR/venv/bin/activate"

# Run pytest
# We pass any command-line arguments you provide to this script directly to pytest
# This allows you to do things like: ./run_tests.sh -v -k "happy_path"
echo "[TEST_RUNNER] Running pytest..."
python3 -m pytest "$SCRIPT_DIR/app/tests" "$@"

echo "[TEST_RUNNER] Tests finished."