Skip to content

Create tests TestExpectedErrorCreateNodeBalancerTypePremiumIPv4BackendConnectivity and TestCreateNodeBalancerTypePremiumVPCBackendConnectivity - #1057

Open
psnoch-akamai wants to merge 1 commit into
linode:mainfrom
psnoch-akamai:test/TPT-4657-linodego-implement-support-for-backend-connectivity-and-premium-types-of
Open

psnoch-akamai wants to merge 1 commit into
linode:mainfrom
psnoch-akamai:test/TPT-4657-linodego-implement-support-for-backend-connectivity-and-premium-types-of

Conversation

@psnoch-akamai

@psnoch-akamai psnoch-akamai commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

✔️ How to Test

make TEST_ARGS="-run TestExpectedErrorCreateNodeBalancerTypePremiumIPv4BackendConnectivity" make TEST_ARGS="-run TestCreateNodeBalancerTypePremiumVPCBackendConnectivity"

To run tests verify required configuration described at JIRA epic ticket.

…dConnectivity and TestCreateNodeBalancerTypePremiumVPCBackendConnectivity
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:22
@psnoch-akamai
psnoch-akamai requested a review from a team as a code owner October 9, 2026 15:22
@psnoch-akamai psnoch-akamai added the testing for updates to the testing suite in the changelog. label Oct 9, 2026
@psnoch-akamai
psnoch-akamai requested a review from a team as a code owner October 9, 2026 15:22
@psnoch-akamai
psnoch-akamai requested review from mawilk90 and zliang-akamai and removed request for a team October 9, 2026 15:22

Copilot AI 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.

🟡 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()
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")

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.

This assertion will fail when fixture is sanitized because IPv6 will be replaced with 1234::5678/96

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.

Moreover, you can use HasSuffix instead of Contains:
assert.True(t, strings.HasSuffix(*nodebalancer.BackendIPv6Prefix, "/96"))

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

Labels

testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants