Repository navigation
test: type remaining test contracts - #294
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 26 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (24)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## Summary - removes the remaining explicit dynamic typing from tests outside the already-merged core, storage, CLI/MCP/UI, pipeline, source-parser, and integration slices - adds typed benchmark fixture protocols and concrete payload contracts for benchmark, fuzz, property, CLI, devtools, security, rendering, and showcase tests - rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders ## Problem After the previous mypy campaign PRs, the remaining test surfaces still relied on explicit Any annotations across benchmark/fuzz/property tests and several focused unit-test areas. That kept the test suite less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes. Ref #281 ## Solution Replace explicit Any annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. The rendering preservation property tests now use a small typed payload model and shared builders instead of repeating untyped nested dict indexing. Benchmark tests use a local BenchmarkFixture protocol, and machine/devtools/showcase/security helpers now preserve concrete boundaries without casts to Any. Touched areas: - tests/benchmarks/ - tests/fuzz/ - tests/property/ - tests/unit/cli/ - tests/unit/devtools/ - tests/unit/rendering/ - tests/unit/security/ - tests/unit/showcase/ ## Verification - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH rg -n "\bAny\b|cast\(Any|typing import .*Any" tests -g "*.py" - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff check --fix tests - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH ruff format tests - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH mypy tests - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH pytest -q tests/unit/security tests/unit/devtools tests/unit/showcase tests/unit/cli/test_machine_main.py tests/unit/cli/test_run.py tests/unit/cli/test_products.py tests/unit/cli/test_qa_requests.py tests/unit/rendering/test_html_highlighting.py tests/property/test_rendering_preservation.py tests/property/test_schema_roundtrip.py - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH devtools verify --quick - PATH=/tmp/polylogue-281/.cache/codex-bin:$PATH git push -u origin feature/refactor/remaining-test-contracts
After the previous mypy PRs, the remaining test surfaces still relied on explicit `Any` annotations across benchmark/fuzz/property tests and several focused unit-test areas. The test suite was less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes. Replaces explicit `Any` annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders instead of repeating untyped nested dict indexing. Benchmark tests use a local `BenchmarkFixture` protocol; machine/devtools/showcase/security helpers preserve concrete boundaries without casts to `Any`. Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`, `tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`, `tests/unit/security/`, `tests/unit/showcase/`. Verification: ruff + mypy + pytest over the touched test trees; devtools verify --quick green. Ref #281
After the previous mypy PRs, the remaining test surfaces still relied on explicit `Any` annotations across benchmark/fuzz/property tests and several focused unit-test areas. The test suite was less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes. Replaces explicit `Any` annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders instead of repeating untyped nested dict indexing. Benchmark tests use a local `BenchmarkFixture` protocol; machine/devtools/showcase/security helpers preserve concrete boundaries without casts to `Any`. Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`, `tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`, `tests/unit/security/`, `tests/unit/showcase/`. Verification: ruff + mypy + pytest over the touched test trees; devtools verify --quick green. Ref #281
After the previous mypy PRs, the remaining test surfaces still relied on explicit `Any` annotations across benchmark/fuzz/property tests and several focused unit-test areas. The test suite was less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes. Replaces explicit `Any` annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. Rewrites rendering preservation property-test setup around local TypedDict payloads and shared model builders instead of repeating untyped nested dict indexing. Benchmark tests use a local `BenchmarkFixture` protocol; machine/devtools/showcase/security helpers preserve concrete boundaries without casts to `Any`. Touched areas: `tests/benchmarks/`, `tests/fuzz/`, `tests/property/`, `tests/unit/cli/`, `tests/unit/devtools/`, `tests/unit/rendering/`, `tests/unit/security/`, `tests/unit/showcase/`. Verification: ruff + mypy + pytest over the touched test trees; devtools verify --quick green. Ref #281
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Problem
After the previous mypy campaign PRs, the remaining test surfaces still relied on explicit Any annotations across benchmark/fuzz/property tests and several focused unit-test areas. That kept the test suite less precise than the now-typed source contracts, especially around generated rendering payloads and machine JSON envelopes.
Ref #281
Solution
Replace explicit Any annotations with concrete pytest, pathlib, JSON, SQLite, Click, protocol, and TypedDict contracts. The rendering preservation property tests now use a small typed payload model and shared builders instead of repeating untyped nested dict indexing. Benchmark tests use a local BenchmarkFixture protocol, and machine/devtools/showcase/security helpers now preserve concrete boundaries without casts to Any.
Touched areas:
Verification