-
Notifications
You must be signed in to change notification settings - Fork 9
144 lines (127 loc) · 5.42 KB
/
Copy pathtests.yml
File metadata and controls
144 lines (127 loc) · 5.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Tests
# Reusable workflow — the single definition of how RAC's test suite runs.
# Called by ci.yml (push to main) and by python-publish.yml (release gate),
# so the test steps live in one place rather than being duplicated.
#
# Tests are split into one "battery" per .py service (plus grouped core / cli /
# artifacts) and run across every supported Python version, so the Actions UI
# names the service + version that failed (e.g. "relationships (py3.11)")
# instead of a single opaque "pytest (3.11)". See ADR-027.
on:
workflow_call:
permissions:
contents: read
jobs:
# Static quality gates (v0.7.14): lint, format, and types fail the suite
# just like a battery. One Python version is enough — the rules target 3.11.
lint:
name: lint (ruff + mypy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install package with dev extras
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: ruff check
run: python -m ruff check src/ tests/
- name: ruff format --check
run: python -m ruff format --check src/ tests/
- name: mypy
run: python -m mypy src/
pytest:
name: ${{ matrix.battery.name }} (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
# One battery per .py service, plus grouped core / cli / artifacts.
# Every tests/test_*.py belongs to exactly one battery (no orphans) —
# enforced by tests/test_ci_batteries.py in the core battery.
battery:
- name: core
paths: "tests/test_validate.py tests/test_parser.py tests/test_schema.py tests/test_identity.py tests/test_frontmatter.py tests/test_metadata_identity.py tests/test_idgen.py tests/test_ci_batteries.py tests/test_corpus.py tests/test_operations.py"
- name: cli
paths: "tests/test_cli.py"
- name: artifacts
paths: "tests/test_design.py tests/test_roadmap.py tests/test_prompt.py tests/test_decision_metadata.py"
- name: create
paths: "tests/test_create.py tests/test_templates.py"
- name: diff
paths: "tests/test_diff.py"
- name: improve
paths: "tests/test_improve.py"
- name: index
paths: "tests/test_index.py"
- name: ingest
paths: "tests/test_ingest.py"
- name: init
paths: "tests/test_init.py"
- name: inspect
paths: "tests/test_inspect.py"
- name: migrate
paths: "tests/test_migrate.py"
- name: portfolio
paths: "tests/test_portfolio.py"
- name: repository
paths: "tests/test_repository.py tests/test_repository_perf.py"
- name: explorer
paths: "tests/test_explorer_adapter.py tests/test_explorer_app.py tests/test_explorer_cli.py tests/test_explorer_commands.py tests/test_explorer_editor.py tests/test_explorer_isolation.py tests/test_explorer_workspace.py"
- name: mcp
paths: "tests/test_mcp_server.py tests/test_mcp_tools.py tests/test_mcp_isolation.py tests/test_mcp_telemetry.py"
- name: relationships
paths: "tests/test_relationships.py tests/test_relationships_cmd.py tests/test_relationship_validation.py"
- name: resolve
paths: "tests/test_resolve.py"
- name: review
paths: "tests/test_review.py"
- name: stats
paths: "tests/test_stats.py"
# Trust gates (v0.7.9): dogfood validates RAC's own rac/ corpus,
# golden pins CLI stdout byte-for-byte against committed files.
- name: dogfood
paths: "tests/test_dogfood.py"
- name: golden
paths: "tests/test_golden.py"
steps:
- uses: actions/checkout@v4
with:
# setuptools-scm derives the version from git tags; fetch them so the
# editable install can resolve a version (mirrors python-publish.yml).
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package with dev/test extras
run: |
python -m pip install --upgrade pip
# The dev extra pulls pytest plus the document libraries that
# tests/test_ingest.py uses to generate fixtures.
python -m pip install -e .[dev]
- name: Run ${{ matrix.battery.name }} battery
run: python -m pytest -q ${{ matrix.battery.paths }}
# Coverage visibility (v0.7.14): one full-suite run on py3.11 with a
# term-missing report in the job log. Report-only — no threshold gate yet
# (measure first, gate later; see the v0.7.14 roadmap Non-Goals).
coverage:
name: coverage (py3.11, report-only)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install package with dev extras
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Run full suite with coverage
run: python -m pytest -q --cov=src/rac --cov-report=term-missing