Repository navigation
Closed
Labels
recipe:implementationRoute through implementation recipeRoute through implementation recipestagedImplementation staged and waiting for promotion to mainImplementation staged and waiting for promotion to main
Description
Problem
8 tests fail on macOS-15 CI with ModuleNotFoundError: No module named 'api_simulator'. The api-simulator package is a Rust/PyO3 extension gated to Linux-only via PEP 508 marker in pyproject.toml:59:
"api-simulator; sys_platform == 'linux'",When uv sync --locked --extra dev runs on macOS (sys_platform == 'darwin'), the package is never installed. Tests that import it without guards crash instead of being gracefully skipped.
Affected Tests
7 tests with bare import api_simulator.claude or import api_simulator.mcp inside test function bodies:
| File | Line(s) | Import |
|---|---|---|
tests/server/test_factory_recording.py |
89, 138, 172, 218 | api_simulator.claude |
tests/server/test_state.py |
132, 211 | api_simulator.mcp |
tests/execution/test_recording.py |
445 | api_simulator.claude |
1 downstream failure — tests/execution/test_recording_sigterm.py:78 (test_sigterm_writes_scenario_json):
- Spawns
autoskillit servewithRECORD_SCENARIO=1 - Server catches
ImportErrorgracefully atsrc/autoskillit/server/_factory.py:241-248and logs:"RECORD_SCENARIO is set but 'api_simulator' is not installed — skipping recording" scenario.jsonis never written, assertion fails
Established Pattern
Other tests are properly guarded — follow the same approach:
# tests/execution/test_quota_http.py:17,25
_api_sim_http = pytest.importorskip("api_simulator.http")
pytestmark = [
pytest.mark.skipif(sys.platform != "linux", reason="api-simulator is Linux-only"),
]Required Fix
Add pytest.importorskip() at the top of each unguarded test function:
- For
test_factory_recording.pytests:pytest.importorskip("api_simulator.claude") - For
test_state.pytests:pytest.importorskip("api_simulator.mcp") - For
test_recording.pytest:pytest.importorskip("api_simulator.claude") - For
test_recording_sigterm.pytest:pytest.importorskip("api_simulator")(entire package needed for recording premise)
Context
- Discovered via PR test #945 macOS-15 CI failure
- Investigation report:
.autoskillit/temp/investigate/investigation_macos_ci_failures_pr945_2026-05-08_160000.md - The
api-simulatorpackage will NOT be cross-compiled for macOS — the platform marker stays as-is
Metadata
Metadata
Assignees
Labels
recipe:implementationRoute through implementation recipeRoute through implementation recipestagedImplementation staged and waiting for promotion to mainImplementation staged and waiting for promotion to main
Activity