Uh oh!
There was an error while loading. Please reload this page.
ESD-1689: Test BGP JSON validation errors at a non-zero connection index - #548
Open
Phil-Browne wants to merge 1 commit into
Open
ESD-1689: Test BGP JSON validation errors at a non-zero connection index#548Phil-Browne wants to merge 1 commit into
Phil-Browne wants to merge 1 commit into
Conversation
Add coverage proving parseBGPConnections reports the correct connection index when the bad-type field is on a non-first entry in a multi-connection bgpConnections array, not just index 0.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #548 +/- ##
=======================================
Coverage 79.50% 79.50% =======================================
Files 193 193 Lines 18859 18859 =======================================
Hits 14993 14993 Misses 2818 2818 Partials 1048 1048 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds targeted regression coverage to ensure parseBGPConnections reports the correct BGP connection index in JSON type-validation errors when the invalid field occurs at a non-zero position within a multi-entry bgpConnections array (e.g., index 1 or 2), rather than only exercising index 0.
Changes:
- Adds a subtest where the second of two BGP connections contains a wrong-typed
shutdownfield and asserts the error reports connection index 1. - Adds a subtest where the third of three BGP connections contains a wrong-typed
medInfield and asserts the error reports connection index 2.
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 freeto 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.
Adds test coverage proving
parseBGPConnectionsreports the correct connection index when the bad-type field is on a non-first entry in a multi-connectionbgpConnectionsarray, not just index 0. Every existing case only ever exercised a single-entry array, so the index arithmetic at a non-zero position was never proven correct.TestParseVRouterConfigBGP: one with a bad field on the second of two connections (index 1), one on the third of three (index 2).Verified the assertions are load-bearing by temporarily swapping the
j/ifaceIndexarguments in production code and confirming both new subtests fail, then reverting.