21 lines
541 B
Bash
21 lines
541 B
Bash
#!/bin/bash
|
|
# SQL-Platform 测试运行脚本
|
|
# 用法: bash run_tests.sh [test_file_or_pattern]
|
|
# 示例: bash run_tests.sh test_auth.py
|
|
# bash run_tests.sh test_ticket
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
BACKEND_PY="$SCRIPT_DIR/backend-python"
|
|
TEST_DIR="$SCRIPT_DIR/tests"
|
|
PYTHON="$BACKEND_PY/venv/bin/python"
|
|
|
|
export PYTHONPATH="$BACKEND_PY"
|
|
|
|
if [ -n "$1" ]; then
|
|
"$PYTHON" -m pytest "$TEST_DIR/$1" -v --tb=short --no-header "$@" 2>&1
|
|
else
|
|
"$PYTHON" -m pytest "$TEST_DIR/" -v --tb=short --no-header 2>&1
|
|
fi
|