Skip to content

Commit 9c53520

Browse files
ci(tests): add cross-platform test workflow + fix drift surfaced by it
Enables the same 3-OS x 4-Python CI matrix that attune-rag uses, gating every PR on ruff + pytest. Enabling CI surfaced four real issues that had accumulated without test automation: - engine.py: `Callable` used at line 580 with no import (F821). Runtime-crashable if _auto_detect_renderer was introspected before call. Added `from typing import Callable`. - test_plugin_config.py: 15 dead tests validating a `plugin/` directory that was never created in this repo (monorepo- extraction carryover). Deleted. - test_plugin_references.py: stale assertions expecting 6 MCP tools (reality: 10) and method-name/tool-name equality (dispatch intentionally renames 3). Rewrote to verify via the real dispatch table — the source of truth for MCP routing. - test_transformers.py: unused `eng` local in test_auto_without_tty_falls_back_to_plain (F841). Removed. Also adds a `[dev]` optional-dependencies extra so CI can do `pip install -e .[dev]` without enumerating test tooling. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 412cedc commit 9c53520

8 files changed

Lines changed: 83 additions & 461 deletions

File tree

.github/workflows/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: test (${{ matrix.os }}, ${{ matrix.python-version }})
15+
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 15
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
python-version: ["3.10", "3.11", "3.12", "3.13"]
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
cache: pip
30+
31+
- name: Install with dev extra
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install -e ".[dev]"
35+
36+
- name: Run ruff
37+
run: python -m ruff check src/ tests/
38+
39+
- name: Run tests
40+
run: python -m pytest tests/ -v --tb=short

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ dependencies = [
3232
[project.optional-dependencies]
3333
rich = ["rich>=13.0.0"]
3434
plugin = ["mcp>=0.9.0"]
35+
dev = [
36+
"pytest>=7.0",
37+
"pytest-cov>=4.0",
38+
"ruff>=0.4.0",
39+
"mcp>=0.9.0",
40+
]
3541

3642
[project.scripts]
3743
attune-help = "attune_help.cli:main"

src/attune_help/engine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import logging
1111
import threading
12+
from collections.abc import Callable
1213
from pathlib import Path
1314

1415
from attune_help.progression import populate_progressive

tests/test_engine.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pathlib import Path
77

88
import pytest
9-
109
from attune_help import HelpEngine, LocalFileStorage
1110
from attune_help.engine import _DEPTH_PROMPTS
1211

0 commit comments

Comments
 (0)