Skip to content

test: cover validation_reasons turned off - #470

Merged
uniqueg merged 1 commit into
devfrom
test/469-validation-reasons
Nov 9, 2026
Merged

uniqueg merged 1 commit into
devfrom
test/469-validation-reasons

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Closes #469

Summary

  • tests/test_app.py: new test_validation_without_reasons. With an overlay that sets exceptions.validation_reasons: false (FOCA 0.22's default; proTES's config sets it to true), an invalid task gets 400 with detail Invalid fields: #/executors (invalid-type), without the rejected value, plus code, type and errors. test_validation_details already covers the true setting.
  • No docs change: docs/upgrading.md ("Validation errors") already describes the option.

How it was verified

  • pytest tests/test_app.py: 15 passed.
  • pre-commit run --files tests/test_app.py: all hooks pass.

Review

adversarial-reviewer and quality-reviewer: no high or medium findings.

Declined review findings

  • (low) Build the client through a fixture factory instead of inline: this is a single test, and the inline client mirrors the client fixture in two lines.
  • (low) "none" not in detail is redundant with the exact match: kept, as it states the intent (the rejected value isn't echoed).

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Tests:

  • Add coverage for validation responses when validation reasons are disabled, including field locations, error codes, and omission of rejected values.

proTES keeps FOCA's validation reason as detail. Test what deployments
get with exceptions.validation_reasons: false (FOCA's default): the
detail names the invalid fields by location and code, without the
rejected values, and the response lists them in errors.

Closes #469

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Add coverage for invalid-task responses when validation reasons are disabled, including the field-based detail and structured error fields.

  • tests/test_app.py L17, L165-198

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (eb596d2) to head (ff71579).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #470   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines         3013      3013           
=========================================
  Hits          3013      3013           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 9, 2026 17:36

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Linked issues

#469 test: cover validation_reasons turned off · 1 of 1 met

# Requirement Status Notes
1 Add a test with validation_reasons disabled that checks an invalid task gets a 400, the detail omits the validator's reason, and errors names the invalid field. ✅ Met The new test sets the overlay to false and asserts the status, concise detail, and structured errors.

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit ede1645 into dev Nov 9, 2026
50 checks passed
@uniqueg
uniqueg deleted the test/469-validation-reasons branch November 9, 2026 18:11
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.

test: cover validation_reasons turned off

1 participant