Skip to content

test: pass-1 recovery + pass-2 LLM/API discipline#16

Merged
silversurfer562 merged 3 commits into
mainfrom
test/pass-2-llm-discipline
May 13, 2026
Merged

test: pass-1 recovery + pass-2 LLM/API discipline#16
silversurfer562 merged 3 commits into
mainfrom
test/pass-2-llm-discipline

Conversation

@silversurfer562
Copy link
Copy Markdown
Member

Summary

Combines two bisectable commits:

  1. test: add coverage gate + tests for benchmark, contracts, providers — recovers the pass-1 work that was authored into PR feat(test): coverage gate + close pass-1 gaps (test-strategy pass 1) #13 but got dropped during merge (the dashboard-v0.2.0 spec migration commit landed instead).
  2. chore(test): add live marker + CI guard for LLM/API discipline (pass 2) — pass-2 Layer 2 work on top.

The two are kept as distinct commits so either can be reverted independently.

Commit 1 — pass-1 recovery (87 new tests; 79.94% branch cov; gate=77)

New file Tests Purpose
tests/unit/test_benchmark.py 19 CLI exit codes, _percentile, _run_benchmark math (benchmark.py was at 10% line cov)
tests/unit/test_contracts.py 58 Locks __all__; pins build_augmented_prompt + RagPipeline.run signatures; pins CitedSource consumer fields
tests/unit/test_providers_base.py 10 LLMProvider Protocol runtime-check semantics + dataclass invariants
tests/README.md How-to-run + LLM-mocking pointer + golden suite policy

Plus: pyproject.toml adds pytest-cov with branch = true and fail_under = 77; tests.yml runs coverage on the ubuntu × py3.11 cell and uploads coverage.xml artifact.

Commit 2 — pass-2 LLM/API discipline

  • pyproject.toml — register live marker; addopts = "-ra -m 'not live'"
  • tests.yml — add CI guard step (before tests) asserting ANTHROPIC_API_KEY is unset for default suite
  • tests/README.md — swap inline LLM section for a pointer to workspace testing-conventions.md

Depends on workspace PR Smart-AI-Memory/attune#4 (testing-conventions.md) for the pointer to resolve.

Test plan

  • pytest --cov locally — 437 passing + 3 xpassed; 79.94% branch coverage
  • ruff check clean
  • CI matrix passes on ubuntu/macos/windows × py3.10–3.13
  • Coverage artifact uploads correctly on the py3.11 cell

Note on PR #13 history

The earlier PR #13 ("docs(specs): split dashboard-v0.2.0 + receive template-path-rename") merged the spec-migration commit but dropped the test work. This PR re-applies it cleanly. Pass 1's task tracker has been updated to reflect this.

🤖 Generated with Claude Code

silversurfer562 and others added 3 commits May 13, 2026 13:10
Establishes a coverage floor and the targeted tests to back it:

- pyproject.toml: [tool.coverage.run] + [tool.coverage.report] with
  fail_under = 77; pytest addopts="-ra"
- .github/workflows/tests.yml: ubuntu × 3.11 runs --cov; XML artifact
  uploaded; other matrix slots stay test-only (faster CI fanout)
- tests/README.md: how to run + interpret the coverage gate
- tests/unit/test_benchmark.py: benchmark.py was at 10% line
  coverage; covers _percentile/_load_queries pure helpers and the
  CLI happy + error paths without spending API tokens
- tests/unit/test_contracts.py: pins the public surface
  (attune_rag.__all__) so silent breakage in consumer layers
  (attune-gui/help/author) is caught at PR time
- tests/unit/test_providers_base.py: pins the LLMProvider protocol
  + the two dataclasses concrete providers consume

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Layer 2 of test-strategy pass 2 (on top of recovered pass-1 commit):

- pyproject.toml: register the `live` pytest marker; update addopts to
  deselect it by default (`-ra -m 'not live'`). Future tests that hit
  the real Anthropic API will be marked @pytest.mark.live and opted
  into via `pytest -m live` locally or the `live-eval` PR label in CI.
- tests.yml: add a CI guard step that fails fast if ANTHROPIC_API_KEY
  is set in the default test environment. Regression alarm — GitHub
  Actions secrets aren't exposed unless explicitly named in env:, so
  this only fires if someone wires a secret into the wrong job.
- tests/README.md: replace the inline LLM-mocking section with a
  pointer to `testing-conventions.md` in the attune workspace umbrella.

Verified locally: 437 passing + 3 xpassed; coverage gate
(`fail_under = 77`) holds.

Spec: /Users/patrickroebuck/attune/specs/test-strategy-pass-2/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The forward-slash literal 'tests/golden' fails on Windows where Path
uses backslashes. Switch to a path-component check that works on
either OS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@silversurfer562 silversurfer562 merged commit eaaed74 into main May 13, 2026
12 checks passed
@silversurfer562 silversurfer562 deleted the test/pass-2-llm-discipline branch May 13, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant