Commit 0b595ea
authored
* test: clean mocked integration tests and add release marker
- Delete tests/integration/test_chat_completion.py and test_embedding.py
(both used MagicMock on the method under test — tested nothing real)
- Move to_langchain() coverage for OpenRouter, xAI, and Google into their
provider test files; drop already-covered OpenAI/Anthropic variants
- Delete tests/integration/test_langchain_integration.py
- Register `release` pytest marker in pyproject.toml and exclude it from
the default addopts with -m 'not release'
- Decorate all 11 test classes in test_tool_calling_real.py with
@pytest.mark.release so they are only collected when explicitly requested
task=t1
validator: DIFF: 8 files changed, 93 insertions(+), 532 deletions(-) — matches expected scope (3 integration files deleted, 3 provider files updated, test_tool_calling_real.py updated, pyproject.toml updated); AC1: tests/integration/ contains only conftest.py and test_tool_calling_real.py — the three deleted files (test_chat_completion.py, test_embedding.py, test_langchain_integration.py) are confirmed absent. conftest.py pre-existed and was not in scope of deletion.; AC2: tests/providers/llm/test_openrouter_provider.py line 344 asserts `langchain_model.openai_api_base == 'https://openrouter.ai/api/v1'` in a test that calls to_langchain().; AC3: tests/providers/llm/test_xai_provider.py line 349 asserts `langchain_model.openai_api_base == 'https://api.x.ai/v1'` in a test that calls to_langchain().; AC4: tests/providers/llm/test_google_provider.py line 781 asserts `isinstance(langchain_model, ChatGoogleGenerativeAI)` in a test that calls to_langchain().; AC5: pyproject.toml [tool.pytest.ini_options] has markers = ['release: real-API tests run before each release (costs money, requires keys)'] and addopts ends with "-m 'not release'".; AC6: 11 @pytest.mark.release decorators confirmed at lines 77, 172, 264, 356, 448, 535, 622, 710, 797, 900, 996 in test_tool_calling_real.py — covering all 11 classes.; AC7: `uv run pytest tests/providers tests/unit tests/common_types tests/test_deprecation_warnings.py -q --no-cov` exited 0 with 996 passed, 1 skipped in 64.59s.; AC8: `uv run pytest -m release --collect-only` lists exactly 11 classes (TestOpenAIToolCalling through TestGoogleToolCalling) all from test_tool_calling_real.py — 22 tests collected.; AC9: `uv run pytest --collect-only` shows no paths containing 'integration/' — default run excludes all integration tests via -m 'not release'.; AC10: `uv run ruff check .` exited 0 — all checks passed.; AC11: `uv run mypy src/esperanto` exited 0 — success: no issues found in 73 source files.
* docs: document release pytest marker in CLAUDE.md, CONTRIBUTING.md, and CHANGELOG
Add Release Tests section explaining that tests/integration/ real-API tests
are gated by the `release` marker, excluded from default pytest runs and CI,
cost money, and require provider keys in .env. Reference #166 and #141.
task=t2
validator: DIFF: 3 files changed, 27 insertions(+), 0 deletions(-) — CHANGELOG.md +1, CLAUDE.md +10, CONTRIBUTING.md +16; AC1: pass — CLAUDE.md lines 274-282 contain a '### Release tests' sub-section under 'For Automated Agents' with all required phrases: 'uv run pytest -m release', 'cost real money', 'require provider keys set in a .env file at the repo root', and 'CI does not run them'; AC2: pass — CONTRIBUTING.md exists (174 lines) with a '## Release Tests' section (lines 102-116) in human-readable prose covering: uv run pytest -m release, costs real money, requires provider API keys in .env, and deliberately excluded from CI; AC3: pass — CHANGELOG.md [Unreleased] ### Changed line 19 contains a new bullet '**Test-infrastructure cleanup**' describing: mocked integration tests removed from tests/integration/, release pytest marker introduced, uv run pytest -m release invocation, to_langchain() coverage moved to per-provider test files, and references (#166, #141)
1 parent d2dcddd commit 0b595ea
11 files changed
Lines changed: 120 additions & 532 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
275 | 285 | | |
276 | 286 | | |
277 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
This file was deleted.
0 commit comments