Skip to content

ESD-1689: Test BGP JSON validation errors at a non-zero connection index - #548

Open
Phil-Browne wants to merge 1 commit into
mainfrom
esd-1689-bgp-connection-index-test
Open

ESD-1689: Test BGP JSON validation errors at a non-zero connection index#548
Phil-Browne wants to merge 1 commit into
mainfrom
esd-1689-bgp-connection-index-test

Conversation

@Phil-Browne

Copy link
Copy Markdown
Contributor

Adds test 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. Every existing case only ever exercised a single-entry array, so the index arithmetic at a non-zero position was never proven correct.

  • Two new subtests in TestParseVRouterConfigBGP: one with a bad field on the second of two connections (index 1), one on the third of three (index 2).
  • Test-only change, no production code touched.

Verified the assertions are load-bearing by temporarily swapping the j/ifaceIndex arguments in production code and confirming both new subtests fail, then reverting.

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

codecovBot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.50%. Comparing base (f266dc2) to head (f94b397).

Additional details and impacted files

Impacted file tree graph

@@ 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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 shutdown field and asserts the error reports connection index 1.
  • Adds a subtest where the third of three BGP connections contains a wrong-typed medIn field and asserts the error reports connection index 2.

Sign up for freeto 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.

2 participants

@Phil-Browne