Files
pzhang_zywl 2ed36c0013
CI / test (pull_request) Successful in 8s
test: 实现端到端验收测试流程 (run_pipeline.py + acceptance.yml) - Closes #12
- scripts/run_pipeline.py: 完整管道运行器 (docx → IR → acceptance tests)
- acceptance.yml: 更新为 workflow_dispatch,支持 --input/--parsed/--test 三种模式
- 失败时自动创建 acceptance-failure issue
2026-05-31 17:01:30 +08:00

63 lines
2.4 KiB
YAML

name: QE Acceptance Tests
on:
workflow_dispatch:
inputs:
prd_path:
description: 'Path to .docx PRD file (absolute)'
required: false
default: ''
parsed_path:
description: 'Path to pre-parsed _updated.json (skip doc_parser if set)'
required: false
default: ''
acceptance_runs:
description: 'Layer B stability runs (1 = skip)'
required: false
default: '1'
jobs:
acceptance:
runs-on: shell
timeout-minutes: 60
steps:
- name: Checkout main branch
run: |
git clone --depth 1 http://localhost:3000/pzhang_zywl/document_analyzer.git .
git checkout main
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run pipeline + acceptance tests
run: |
if [ -n "${{ github.event.inputs.prd_path }}" ]; then
python scripts/run_pipeline.py --input "${{ github.event.inputs.prd_path }}" --test
elif [ -n "${{ github.event.inputs.parsed_path }}" ]; then
python scripts/run_pipeline.py --parsed "${{ github.event.inputs.parsed_path }}" --test
else
# No input provided — run acceptance on existing output if present
python -m pytest tests/acceptance/ -v --run-acceptance \
--acceptance-runs=${{ github.event.inputs.acceptance_runs }} --tb=short
fi
env:
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
- name: Create issue on failure
if: failure()
env:
GITEA_API_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
# Read acceptance report summary if it exists
if [ -f acceptance-report.json ]; then
SUMMARY=$(python -c "import json; r=json.load(open('acceptance-report.json')); print(r.get('final_verdict','?'))")
DETAILS=$(python -c "import json; r=json.load(open('acceptance-report.json')); fd=r.get('failure_details',[]); print('\\n'.join(f'- {d}' for d in fd) if fd else '')")
fi
python scripts/create_failure_issue.py \
--sha "${{ github.sha }}" --branch "main" \
--run "${{ github.run_number }}" \
--message "QE Acceptance: ${SUMMARY:-pipeline failed}" \
--workflow "QE Acceptance" \
--labels "acceptance-failure,agent-task"