Repository navigation
feat: enrich FailureInfo with FailureAssessment and mock mismatch data - #3996
Conversation
Add RejectionReason and NoiseFailureReason typed enums for classifying why test cases are unreplayable during autoreplay. Extend FailureInfo to carry the full FailureAssessment (AddedFields, RemovedFields, TypeChanges, ValueChanges, Reasons) and MockMismatchInfo (expected vs actual mocks with name + kind). Store FailureAssessment in HTTP and gRPC matchers instead of discarding it after extracting Risk/Category. Populate MockMismatchInfo on TestResult for obsolete test cases with rich mock metadata.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds infrastructure for enriching Key observations:
Files Reviewed (4 files)
Reviewed by claude-opus-4.5 · 295,791 tokens |
There was a problem hiding this comment.
Pull request overview
This PR enriches replay failure reporting by carrying structured failure assessment details (risk/category plus detailed assessment data) through HTTP/gRPC matchers and by attaching mock mismatch metadata for obsolete test cases, enabling downstream components (API/UI) to explain why a test is unreplayable.
Changes:
- Extend
models.FailureInfowithAssessmentandMockMismatchplus new enums for rejection/noise failure reasons. - Preserve and propagate JSON body
FailureAssessmentfrom HTTP and gRPC matchers intoFailureInfo. - Populate
MockMismatchInfoon obsolete test results during replay when mock-set mismatch is detected.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/models/testrun.go | Adds new failure classification enums and extends FailureInfo with assessment and mock mismatch metadata models. |
| pkg/matcher/http/match.go | Keeps the computed JSON FailureAssessment instead of discarding it after extracting risk/category. |
| pkg/matcher/grpc/match.go | Same as HTTP matcher: propagates JSON FailureAssessment into FailureInfo. |
| pkg/service/replay/replay.go | Copies matcher assessment into stored test results and attaches expected vs actual mock metadata for obsolete test cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
…le tests - Add ConsumedMock and UnmatchedCall structs to FailureInfo on TestResult - Populate consumed mocks and unmatched calls for failed test cases - Add GetMockErrors HTTP API endpoint on agent for remote error transport - Add GetFailuresForTestCase to TestFailureStore for per-test-case lookup - Fix HTTP outgoing mock recording not persisting in non-synchronous mode - Store FailureAssessment in HTTP/gRPC matchers instead of discarding - Add RejectionReason and NoiseFailureReason enums - Extend FailureInfo with Assessment and MockMismatchInfo fields
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
21c5661 to
51b3b64
Compare
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
- Rename ConsumedMock to MatchedCall with fields: MockName, Protocol, Summary - Rename FailureInfo.ConsumedMocks to FailureInfo.MatchedCalls - Add MockSummaryFromSpec() for protocol-generic summaries (HTTP, DNS, MongoDB, MySQL, PostgreSQL, gRPC, Redis, Generic) - Add PreserveFailedMocks config flag to skip mock pruning when tests fail - Use mock registry lookup to build summaries for matched calls
- Normalize expected mock Kind from mockKindByName when empty - Remove accidental blank line in mockmanager.go - Restore accidentally deleted keploy.sh
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…optimization, race fix
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…iluresForTestCase
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In synchronous mode, always route HTTP mocks through the sync manager for correct time-window association. In non-synchronous mode (k8s-proxy), send directly to the mocks channel to ensure persistence.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When monitorProxyErrors receives context cancellation, Go's select may pick ctx.Done() over pending errors in the channel. This caused mock-not-found errors to be lost, resulting in empty UnmatchedCalls. Now drains remaining errors before returning.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
Logs at key points to trace where mock-not-found errors are lost: - monitorProxyErrors: when errors arrive and when ctx.Done fires - GetFailuresForTestCase: all stored failures and match results - replay.go: channel path count, GetMockErrors fallback, final total
This reverts commit d5f9ad7.
This reverts commit df52a0d.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
…in GetFailuresForTestCase" This reverts commit 0888c38.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Describe the changes that are made
RejectionReasonandNoiseFailureReasontyped enums topkg/models/testrun.gofor classifying why test cases are unreplayable during autoreplayFailureInfostruct withAssessment *FailureAssessmentandMockMismatch *MockMismatchInfofieldsMockMismatchMockandMockMismatchInfostructs to carry expected vs actual mock metadata (name + kind)FailureAssessmentin HTTP matcher (pkg/matcher/http/match.go) and gRPC matcher (pkg/matcher/grpc/match.go) instead of discarding it after extracting Risk/CategoryMockMismatchInfoonTestResultfor obsolete test cases inpkg/service/replay/replay.goLinks & References
Closes: NA
🔗 Related PRs
TestCaseFailureDetailsstruct using these enums🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Deploy all 4 PRs (keploy → api-server → k8s-proxy → enterprise-ui), then:
FailureInfowithAssessmentandMockMismatchdataSelf Review done?