Skip to content

Fix flaky 404 and 406 preparators - #90

Merged
sidux merged 2 commits into
mainfrom
fix/deterministic-negative-api-tests
Aug 13, 2026
Merged

sidux merged 2 commits into
mainfrom
fix/deterministic-negative-api-tests

Conversation

@sidux

@sidux sidux commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • reuse valid operation examples for 404 and 406 cases
  • use a stable unsupported media type instead of random MIME types
  • select missing-resource parameters by URI order
  • generate a different schema-valid missing path value, or skip unsafe cases
  • preserve deep-object query parameters and request bodies

Tests

  • composer check-cs
  • composer check-static
  • composer test (119 tests, 284 assertions)
  • focused SdZv4 404 integration test

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Issued by Coverage Checker:

Coverage

✅ Your code coverage has not been degraded 🎉

Measure Main branch refs/pull/90/merge
Coverage 57.966% 59.307%
Total lines 3402 3551
Covered lines 1972 2106

∆ 1.341

🟢 ↗️ Improved files:

File On main branch refs/pull/90/merge
APITester/APITester/src/Schema/Entity/Example/OperationExample.php 250 / 296 (84.459%) 254 / 296 (85.811%)

🔴 ↘️ Degraded files:

File On main branch refs/pull/90/merge
APITester/APITester/src/Test/Preparator/Error404Preparator.php 29 / 29 (100%) 160 / 179 (89.385%)

@sidux
sidux requested review from Dzov and a balanced review from Copilot August 13, 2026 09:50

Copilot AI 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.

Pull request overview

Makes 404 and 406 test generation deterministic while preserving valid operation examples.

Changes:

  • Reuses operation examples and preserves request data.
  • Generates stable missing-resource values and unsupported media types.
  • Adds regression tests and configuration documentation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Test/Preparator/Error404Preparator.php Generates stable 404 path values.
src/Test/Preparator/Error406Preparator.php Reuses examples with deterministic media types.
src/Test/Preparator/Config/Error406PreparatorConfig.php Changes default media type and case count.
tests/Preparator/Error404PreparatorTest.php Tests preserved data and stable paths.
tests/Preparator/Error406PreparatorTest.php Tests example reuse and deterministic selection.
docs/preparators-config.md Documents updated preparator behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Test/Preparator/Error404Preparator.php Outdated
Comment thread src/Test/Preparator/Error404Preparator.php Outdated
Comment thread src/Test/Preparator/Error404Preparator.php
Comment thread src/Test/Preparator/Error404Preparator.php Outdated
Comment thread src/Test/Preparator/Error404Preparator.php Outdated
Comment thread src/Test/Preparator/Error404Preparator.php Outdated
@sidux
sidux merged commit 62446ae into main Aug 13, 2026
4 checks passed
@sidux
sidux deleted the fix/deterministic-negative-api-tests branch August 13, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants