Skip to content
Merged
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
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ def pytest_addoption(parser: pytest.Parser) -> None:
default=None,
help="Git base ref for changed-file detection (overrides AUTOSKILLIT_TEST_BASE_REF).",
)
parser.addoption(
"--update-fixtures",
action="store_true",
default=False,
help="Regenerate deterministic conformance fixtures in-place instead of asserting.",
)


def pytest_configure(config: pytest.Config) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/execution/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,6 @@ Subprocess integration, headless session, process lifecycle, and session result
| `test_codex_stream_parser.py` | Full test suite for CodexStreamParser: happy-path, item parsing, degradation, fixture-driven integration, protocol conformance |
| `test_codex_result_parser.py` | Tests for CodexResultParser |
| `test_codex_config.py` | Tests for TOML read/write primitives, _is_autoskillit_registered, and ensure_codex_mcp_registered |
| `test_codex_deterministic_conformance.py` | Sealed-enum vocabulary, hook event format, and config.toml schema template conformance tests with --update-fixtures review gate |
| `test_cmd_builder.py` | CmdBuilder ordering invariant and CmdSpec origin tests |
| `test_coding_agent_backend_conformance.py` | Parametrized conformance tests for all CodingAgentBackend implementations via BackendContractBase |
9 changes: 9 additions & 0 deletions tests/execution/backends/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@
import re
from pathlib import Path

import pytest

from autoskillit.hook_registry import HOOK_REGISTRY


@pytest.fixture
def update_fixtures(request: pytest.FixtureRequest) -> bool:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[warning] cohesion: The update_fixtures fixture is defined only in tests/execution/backends/conftest.py but --update-fixtures CLI option is registered in the top-level tests/conftest.py. If future tests outside tests/execution/backends/ need this fixture, it will be unavailable. Consider co-locating the fixture at the top-level conftest.py alongside the option registration.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid observation β€” flagged for design decision. The --update-fixtures CLI option is registered in the top-level tests/conftest.py per pytest requirements, while the update_fixtures fixture wrapping it is defined only in tests/execution/backends/conftest.py β€” intentional co-location with its sole consumer. Moving the fixture to the top-level conftest is a valid future-proofing step if the option is expected to become reusable, but requires a human decision on whether this is expected to remain backends-only.

"""Expose --update-fixtures CLI flag as a fixture."""
return bool(request.config.getoption("--update-fixtures"))


# Local mirror of _SKIP_CODEX_STATUSES from autoskillit.execution.backends._codex_hooks.
# Defined here so the conftest has no import dependency on execution.backends (which
# would create a tests/ -> execution/ IL cycle for the backends subdirectory).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"item": {
"properties": {
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"type": {
"const": "item.completed",
"type": "string"
}
},
"required": [
"type",
"item"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"type": {
"const": "item.started",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"type": {
"const": "item.updated",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"thread_id": {
"type": "string"
},
"type": {
"const": "thread.started",
"type": "string"
}
},
"required": [
"type",
"thread_id"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"type": {
"const": "turn.completed",
"type": "string"
},
"usage": {
"type": "object"
}
},
"required": [
"type",
"usage"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"error": {
"oneOf": [
{
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
},
{
"type": "string"
}
]
},
"type": {
"const": "turn.failed",
"type": "string"
}
},
"required": [
"type",
"error"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"type": {
"const": "turn.started",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
Loading
Loading