fix(data-integrity): fix validation_apply.py all_required_ fields #7508
ISSUES CLOSED: #7508
This commit is contained in:
@@ -84,11 +84,11 @@ Feature: Consolidated Validation
|
||||
And the apply summary informational failed count should be 1
|
||||
|
||||
|
||||
Scenario: Empty summary reports all required passed
|
||||
Scenario: Empty summary blocks apply
|
||||
Given a validation apply test environment
|
||||
Given an empty apply validation summary
|
||||
Then the apply summary should be empty
|
||||
And the apply summary should report all required passed
|
||||
And the apply summary should not report all required passed
|
||||
|
||||
|
||||
Scenario: Summary to_plan_metadata has expected fields
|
||||
@@ -183,10 +183,10 @@ Feature: Consolidated Validation
|
||||
Then the gate failure reasons should mention "error:"
|
||||
|
||||
|
||||
Scenario: Gate with no attachments allows apply
|
||||
Scenario: Gate with no attachments blocks apply
|
||||
Given a validation apply test environment
|
||||
When I run the apply validation gate for plan "01PLAN0001" with no attachments
|
||||
Then the gate should allow apply
|
||||
Then the gate should block apply
|
||||
And the apply summary should be empty
|
||||
|
||||
|
||||
@@ -467,4 +467,3 @@ Feature: Consolidated Validation
|
||||
Given a thread-local stream wrapping a mock original stream
|
||||
When capture is stopped on the thread-local stream
|
||||
Then the captured text should be empty
|
||||
|
||||
|
||||
@@ -140,6 +140,11 @@ class ApplyValidationSummary(BaseModel):
|
||||
1 for r in self.results if r.mode == ValidationMode.REQUIRED and r.passed
|
||||
)
|
||||
|
||||
@property
|
||||
def required_total(self) -> int:
|
||||
"""Total number of required validations that were evaluated."""
|
||||
return sum(1 for r in self.results if r.mode == ValidationMode.REQUIRED)
|
||||
|
||||
@property
|
||||
def required_failed(self) -> int:
|
||||
"""Number of required validations that failed."""
|
||||
@@ -170,6 +175,8 @@ class ApplyValidationSummary(BaseModel):
|
||||
@property
|
||||
def all_required_passed(self) -> bool:
|
||||
"""Whether all required validations passed."""
|
||||
if self.is_empty:
|
||||
return False
|
||||
return self.required_failed == 0
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user