tests: add unit tests for extraction validator review workflow#423
Open
Arijit429 wants to merge 8 commits intofireform-core:mainfrom
Open
tests: add unit tests for extraction validator review workflow#423Arijit429 wants to merge 8 commits intofireform-core:mainfrom
Arijit429 wants to merge 8 commits intofireform-core:mainfrom
Conversation
Author
|
Added focused unit tests for the validator workflow and verified the core review scenarios locally — happy to extend coverage further based on feedback. |
70bd363 to
1544bbe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Summary
This PR adds dedicated unit tests for the extraction validation and review workflow to improve reliability and ensure consistent behavior across common edge cases.
The goal is to strengthen confidence in the validation pipeline introduced earlier by verifying expected behavior for complete, incomplete, null, and placeholder-based extraction outputs.
✨ What Changed
Added a new test file:
This introduces focused unit tests for the
ExtractionValidatorclass.🧪 Test Coverage Added
1) Missing fields should require review
Validates that incomplete extraction outputs correctly trigger:
and reduce the confidence score.
2) Complete fields should not require review
Ensures that fully populated structured outputs return:
with full confidence.
3) Null field handling
Verifies that
Nonevalues are correctly treated as missing data and routed for review.4) Placeholder value handling
Tests edge cases where placeholder values such as:
are returned by the extraction pipeline.
These should also trigger review.
💡 Why This Helps
This improves confidence in the validation workflow and ensures that downstream form filling logic receives consistently validated outputs.
This directly strengthens:
🔍 Code-Level Focus
The tests primarily validate:
and confirm the expected response structure:
{ "requires_review": ..., "confidence_score": ..., "missing_fields": ... }🧪 Local Testing
Executed using:
and verified successful execution of all added test cases.
🎯 Impact
This PR improves maintainability and makes future validator enhancements safer by introducing a dedicated automated test layer.