Skip to content

test: enforce generated model contracts#17

Merged
kriptoburak merged 1 commit into
mainfrom
codex/generated-coverage
Jul 24, 2026
Merged

test: enforce generated model contracts#17
kriptoburak merged 1 commit into
mainfrom
codex/generated-coverage

Conversation

@kriptoburak

@kriptoburak kriptoburak commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • discover every generated JSON model, request params builder, and enum on the compiled classpath
  • verify missing, invalid, unknown, fully populated, copy, equality, and JSON round-trip behavior
  • exercise recursive validation and builder contracts without changing runtime code or public APIs

OpenSSF Evidence

The generated-inclusive JaCoCo report now measures:

  • 94.05% line coverage (85,823 of 91,257)
  • 92.81% branch coverage (22,231 of 23,952)

The maintained-source report remains above policy:

  • 90.83% line coverage
  • 81.54% branch coverage

Verification

  • ./scripts/lint
  • ./scripts/test --rerun-tasks (1,346 tests, 0 failures, 0 errors, 0 skipped)
  • ./scripts/coverage --rerun-tasks
  • ./scripts/audit (license policy and OSV scan)
  • uvx reuse lint (REUSE 3.3 compliant)
  • ./scripts/check-reproducible (15 byte-identical Maven artifacts)

Review Notes

This test-only change protects generated SDK contracts across future OpenAPI regenerations. Another human must review this nontrivial maintainer-authored change before merge.

Note

Add contract test suite for generated API models, params, and enums

  • Adds GeneratedModelContractTest.kt, a JUnit test class that scans compiled classes under com.x_twitter_scraper.api.models at test runtime.
  • Verifies builder, JsonField, additionalProperties, equality/hashCode/toString, and validation contracts for generated models; checks builder/getter behavior for params; and asserts correct known/unknown/invalid semantics for enum wrappers.
  • Enforces minimum class-count floors so the build fails if generated output drops below expected counts.

Macroscope summarized 9ac4a2d.

Signed-off-by: kriptoburak <kriptoburak@users.noreply.github.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@kriptoburak
kriptoburak requested a review from furkanerday July 24, 2026 15:41

@furkanerday furkanerday left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the complete diff, description, discussion, repository policies, public contracts, relevant tests, required checks, and commit sign-offs at 9ac4a2d. All required checks pass, no unresolved threads remain, and I found no blocking issue.

@kriptoburak
kriptoburak merged commit 38a2227 into main Jul 24, 2026
18 checks passed
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.

2 participants