ci(P2-5): 测试失败时上传结果产物,pytest输出改为详细模式

This commit is contained in:
2026-07-09 13:58:09 +08:00
parent e14e007537
commit 48f5f8efa5
+13 -2
View File
@@ -176,7 +176,8 @@ jobs:
USE_IN_MEMORY_DB: "true"
run: |
set -eu
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/unit -q
mkdir -p test-results
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/unit -v --junitxml=test-results/unit-tests.xml --tb=short
- name: Start PostgreSQL for integration tests
shell: sh
@@ -221,7 +222,17 @@ jobs:
run: |
set -eu
pip install -q pytest-rerunfailures
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/integration -q --timeout=60 -x --reruns 2 --reruns-delay 1 -m "not performance"
mkdir -p test-results
PYTHONPATH="$PWD/apps/api:$PWD" python3 -m pytest tests/integration -v --timeout=60 -x --reruns 2 --reruns-delay 1 -m "not performance" --junitxml=test-results/integration-tests.xml --tb=short
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ github.run_id }}
path: |
test-results/
*.log
- name: Run API performance baseline tests
shell: sh