Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pytest:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# setuptools-scm derives the package version from git history.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt

- name: Install UCAgent and pytest
run: |
python -m pip install --upgrade pip
python -m pip install -e . pytest

- name: Run unit tests
# tests/test_mcps.py is a manual script that needs a live MCP server on
# localhost:5000 and the separate fastmcp package, so it is not collected.
run: python -m pytest tests --ignore=tests/test_mcps.py -q

node-tests:
name: Web UI tests (Node.js)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Run Node.js tests
run: node --test tests/*.js
6 changes: 3 additions & 3 deletions tests/test_waveform_prompt_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_default_prompt_requires_waveinfo_for_dynamic_bugs():
assert "不要急于修改测试" not in parent_task
assert "每个Fail TC都不预设责任方" in system_prompt
assert "progress_summary.status: batch_advanced" in system_prompt
assert "不是Checker失败" in system_prompt
assert "不是验证失败" in system_prompt
assert "不得把`check_pass: false`单独解释为验证失败" in system_prompt
assert "specification_expected" in system_prompt
assert "精确input、specification_expected、测试代码中的test_expected、DUT actual和classification" in system_prompt
Expand Down Expand Up @@ -680,13 +680,13 @@ def test_bug_document_error_help_uses_current_machine_contract():
assert "every visible title must describe the actual item" in help_text
assert "visible heading reuses the TC title" in help_text
assert "Every remaining FAILED DUT test" in help_text
assert "Every remaining failed checkpoint" in help_text
assert "Every remaining unhit checkpoint" in help_text
assert "prefer record_dynamic_bug.py with -MODE bug" in help_text
assert "-MODE root for each distinct ROOT" in help_text
assert "if the same blocker remains" in help_text
assert "manual_edit_fallback scope and after_edit call" in help_text
assert "immediately rerun -MODE repair and Check" in help_text
assert "A failed checkpoint does not by itself prove a DUT Bug" in help_text
assert "An unhit checkpoint does not by itself prove a DUT Bug" in help_text
assert "test stimulus/driver" in help_text
assert "checkpoint that is itself PASSED" in help_text
assert "derive an independent expected value" in help_text
Expand Down