feat(test): coverage gate + restore ADR-002 (test-strategy pass 1)#7
Merged
Merged
Conversation
Pass 1 of the test-strategy spec for the attune product family.
ADR-002 restoration:
- Move attune-author from required dep to [authoring] extra in
pyproject.toml; restores zero-required-deps beyond python-frontmatter.
- Guard the 4 deprecated shim modules (manifest, staleness,
freshness, freshness.symbols) with try/except ImportError that
points users to ``pip install attune-help[authoring]``.
- Gate the 4 shim test files with ``pytest.importorskip``.
New test files (44 new tests):
- test_zero_dep_install.py — fresh-venv smoke test verifying the
zero-dep import contract; marked @pytest.mark.slow.
- test_storage_protocol.py — reusable StorageProtocolTester mixin
exercising the SessionStorage Protocol against LocalFileStorage
+ a reference in-memory backend.
- test_templates.py — direct tests for _find_template_file (incl.
CWE-22 traversal guard), _parse_template_file, and the mtime-aware
parse cache.
- test_adapter_rag.py — AttuneHelpAdapter defaults, override paths,
protocol conformance.
- test_mcp_handlers.py — _require_str validator paths, engine
builder, server factory + singleton.
Coverage gate:
- pytest-cov configured with branch coverage and fail_under = 81
(measure-then-lock at baseline-2pp). Current measurement: 82.31%.
- Registered the ``slow`` marker.
- tests.yml: coverage on ubuntu x py3.11 cell only; new
test-no-authoring-extra job verifies importorskip skip path.
- New tests/README.md documenting how to run + the LLM-mocking
pattern (attune-author conftest is the reference for pass 2).
Spec: specs/test-strategy/{requirements,design,tasks}.md
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pass 1 of the test-strategy spec — Layer 1 (attune-help). Closes coverage gaps, adds missing test types, restores ADR-002 (zero required deps beyond
python-frontmatter), and lands a CI coverage gate.attune-authorto the[authoring]extraWhat changed
ADR-002 restoration
attune-authorfrom[project.dependencies]to[project.optional-dependencies.authoring]inpyproject.toml.try/except ImportErrorpointing users topip install attune-help[authoring].pytest.importorskip(\"attune_author\")totest_manifest.py,test_staleness.py,test_symbols.py,test_authoring_shims.py.New test files
tests/test_zero_dep_install.py@pytest.mark.slow).tests/test_storage_protocol.pyStorageProtocolTestermixin verifying theSessionStorageProtocol againstLocalFileStorage+ an in-memory reference impl (8 tests).tests/test_templates.py_find_template_file(incl. CWE-22 guard),_parse_template_file, and the mtime-aware parse cache (12 tests).tests/test_adapter_rag.pyAttuneHelpAdapterdefaults, override paths, protocol conformance (6 tests).tests/test_mcp_handlers.py_require_str, engine builder, server factory + singleton (13 tests).Coverage + CI
pyproject.tomlgains[tool.pytest.ini_options](registeredslowmarker) and[tool.coverage.*]withbranch = trueandfail_under = 81.tests.ymlruns coverage only on theubuntu-latest x py3.11cell of the existing matrix; uploads the report as an artifact.test-no-authoring-extrajob verifies theimportorskipskip path actually works when the extra isn't installed.tests/README.mddocuments how to run tests and points at the attune-author conftest as the LLM-mocking reference (pass 2 will formalize).Test plan
pytest --covlocally — 309 passing, 82.31% branch coverageruff check src/ tests/cleantest-no-authoring-extrajob passesRollback
Revert in this order if needed:
fail_underline inpyproject.toml(releases the gate without losing tests)try/exceptguards + testimportorskiplinesNotes
DeprecationWarningoutputs in the test run are intentional — the shim modules emit them by design until the 2026-07-07 sunset.🤖 Generated with Claude Code