Repository navigation
Create tests TestExpectedErrorCreateNodeBalancerTypePremiumIPv4BackendConnectivity and TestCreateNodeBalancerTypePremiumVPCBackendConnectivity - #1057
Open
psnoch-akamai wants to merge 1 commit into
Open
psnoch-akamai wants to merge 1 commit into
psnoch-akamai wants to merge 1 commit into
Conversation
…dConnectivity and TestCreateNodeBalancerTypePremiumVPCBackendConnectivity
psnoch-akamai
requested review from
mawilk90 and
zliang-akamai
and removed request for
a team
October 9, 2026 15:22
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cleanup ordering breaks fixture lifecycle, and the negative test captures an unrelated capacity error.
1 open finding
What changed in this PR
Adds integration coverage for premium NodeBalancer backend connectivity.
Changes:
- Tests successful VPC backend creation and legacy IPv4 rejection.
- Adds replay fixtures and adopts Go 1.26 pointer initialization syntax.
| File | Description |
|---|---|
test/unit/nodebalancer_test.go |
Updates pointer initialization. |
test/integration/nodebalancers_test.go |
Adds premium backend connectivity tests. |
test/integration/fixtures/TestNodeBalancer_TypePremiumVPCBackendConnectivity.yaml |
Records successful VPC creation. |
test/integration/fixtures/TestNodeBalancer_TypePremiumIPv4BackendConnectivity.yaml |
Records failed legacy connectivity creation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| func TestCreateNodeBalancerTypePremiumVPCBackendConnectivity(t *testing.T) { | ||
| client, fixtureTeardown := createTestClient(t, "fixtures/TestNodeBalancer_TypePremiumVPCBackendConnectivity") | ||
| defer fixtureTeardown() |
mawilk90
reviewed
Oct 12, 2026
| require.Equal(t, linodego.NBTypePremium, nodebalancer.Type) | ||
| require.Equal(t, createOpts.Region, nodebalancer.Region) | ||
| assert.Equal(t, "vpc", string(*nodebalancer.BackendConnectivity)) | ||
| assert.Contains(t, *nodebalancer.BackendIPv6Prefix, "::/96") |
Contributor
There was a problem hiding this comment.
This assertion will fail when fixture is sanitized because IPv6 will be replaced with 1234::5678/96
Contributor
There was a problem hiding this comment.
Moreover, you can use HasSuffix instead of Contains:
assert.True(t, strings.HasSuffix(*nodebalancer.BackendIPv6Prefix, "/96"))
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 free
to 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.

✔️ How to Test
make TEST_ARGS="-run TestExpectedErrorCreateNodeBalancerTypePremiumIPv4BackendConnectivity" make TEST_ARGS="-run TestCreateNodeBalancerTypePremiumVPCBackendConnectivity"To run tests verify required configuration described at JIRA epic ticket.