Skip to content

chore(test): relocate bridge-as-gateway no-longer-fails pin to multidoc test file#209

Merged
lexfrei merged 1 commit into
mainfrom
chore/move-bridge-as-gateway-test
May 14, 2026
Merged

chore(test): relocate bridge-as-gateway no-longer-fails pin to multidoc test file#209
lexfrei merged 1 commit into
mainfrom
chore/move-bridge-as-gateway-test

Conversation

@lexfrei
Copy link
Copy Markdown
Contributor

@lexfrei lexfrei commented May 14, 2026

Closes #168.

What

Pure test relocation: TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails and its bridgeAsGatewayLookup fixture move from pkg/engine/contract_errors_test.go to pkg/engine/contract_network_multidoc_test.go, with the test renamed to TestContract_NetworkMultidoc_BridgeAsGateway_NoLongerFails to fit the destination file's naming convention.

Why

The test stopped pinning an error contract once BridgeConfig emission landed — it now asserts a clean render. Hosting it under contract_errors_test.go (which catalogues fail-shape tests) was misleading; a reader landing on the name prefix expects a fail-test.

Scope

  • Test function moved + renamed.
  • bridgeAsGatewayLookup fixture moved alongside its sole consumer.
  • Section header // === Bridge as gateway: no longer fails === added in the new location to match the file's existing // === Section === style.
  • Catalogue header in contract_errors_test.go renumbered: items 5/6 → 4/5, with a one-line pointer to the new home of the bridge-as-gateway pin.

No production code touched. Test logic and assertions unchanged.

Validation

  • go test ./... -count=1 all green
  • golangci-lint run ./... 0 issues

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where network contract validation would fail when a bridge was configured as the IPv4 default gateway. Network configuration rendering now completes successfully in this scenario.

Review Change Stack

…oc test file

TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails lived in
contract_errors_test.go but stopped pinning an error contract once
BridgeConfig emission landed — it now asserts a clean render. A
future reader landing in contract_errors_test.go on the name
prefix would expect a fail-test and find an assert-clean-render
test instead.

Move the function next to TestContract_NetworkMultidoc_BridgeConfigEmitted
in contract_network_multidoc_test.go so the file location matches
the contract being pinned, and rename it to
TestContract_NetworkMultidoc_BridgeAsGateway_NoLongerFails to fit
the surrounding naming convention. The bridgeAsGatewayLookup
fixture moves alongside its sole consumer; no other test in the
package references it.

Section header `=== Bridge as gateway: no longer fails ===` added
in the new location to match the file's existing indexing style
(`=== Section ===` markers used throughout). Catalogue header in
contract_errors_test.go renumbered: item 4 dropped, items 5/6
renumbered to 4/5, with a one-line pointer to the new home of the
bridge-as-gateway pin so a reader who indexes the file by that
catalogue is led to the right place.

Pure relocation + comment cleanup; test logic and assertions
unchanged.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3cbb38f7-ee8f-4716-ad03-a621151ac41a

📥 Commits

Reviewing files that changed from the base of the PR and between 6e914ea and 5d945ac.

📒 Files selected for processing (2)
  • pkg/engine/contract_errors_test.go
  • pkg/engine/contract_network_multidoc_test.go

📝 Walkthrough

Walkthrough

This PR reorganizes test coverage for the bridge-as-gateway network scenario, moving its passing test case from the error contract tests file to the network multidoc contracts file. The fail catalogue comment is updated, the old test and fixture are removed, and new test infrastructure is added in the target location.

Changes

Bridge-as-Gateway Test Reorganization

Layer / File(s) Summary
Move bridge-as-gateway test from errors to multidoc contracts
pkg/engine/contract_errors_test.go, pkg/engine/contract_network_multidoc_test.go
The fail catalogue comment is updated to remove the bridge-as-gateway entry and note its new location. The old test TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails and its bridgeAsGatewayLookup fixture are deleted from contract_errors_test.go. A new bridgeAsGatewayLookup fixture and TestContract_NetworkMultidoc_BridgeAsGateway_NoLongerFails test are added to contract_network_multidoc_test.go, verifying both chart types render without error when a bridge carries the IPv4 default route.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 A test hops from the error pen,
To the multidoc home again—
Bridge-as-gateway now thrives true,
No longer fails, just renders through! 🌉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/move-bridge-as-gateway-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lexfrei lexfrei marked this pull request as ready for review May 14, 2026 14:53
@lexfrei lexfrei added kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt area/testing Issues or PRs related to testing (unit, integration, e2e) labels May 14, 2026
@lexfrei lexfrei merged commit a0bd589 into main May 14, 2026
7 of 8 checks passed
@lexfrei lexfrei deleted the chore/move-bridge-as-gateway-test branch May 14, 2026 14:53
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request moves the TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails test and its associated lookup function from pkg/engine/contract_errors_test.go to pkg/engine/contract_network_multidoc_test.go. This relocation reflects that the "bridge as gateway" scenario is no longer an error condition since BridgeConfig emission was implemented. I have no feedback to provide as there were no review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Issues or PRs related to testing (unit, integration, e2e) kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: move TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails out of contract_errors_test.go

1 participant