TPT-4368: Update integration tests due to deprecated "vpcs" for NB create#926
Conversation
7c8d1ed to
33f7afa
Compare
…-update-integration-tests-due-to-deprecated-vpcs-for-nb-create
dawiddzhafarov
left a comment
There was a problem hiding this comment.
LGTM and tests pass!
There was a problem hiding this comment.
Pull request overview
Updates Linodego integration tests/fixtures to account for the deprecation of the vpcs field on NodeBalancer create requests in favor of backend_vpcs, while also adding coverage to ensure the deprecated field remains accepted for now.
Changes:
- Updated NodeBalancer integration test setup helpers to send
backend_vpcsinstead ofvpcs. - Refreshed integration fixtures to match the new request payloads (
backend_vpcs) and updated recorded responses. - Added a new integration test + fixture to validate the deprecated
vpcscreate attribute is still accepted.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/integration/nodebalancers_test.go | Switches create options to BackendVPCs in helpers; adds a new test for deprecated VPCs usage. |
| test/integration/fixtures/TestNodeBalancer_Create_WithFrontendAndBackendInDifferentVPCs.yaml | Updates recorded POST body from vpcs to backend_vpcs (plus re-recorded fixture deltas). |
| test/integration/fixtures/TestNodeBalancer_Create_WithDeprecatedVPCsAttribute.yaml | New fixture for the deprecated vpcs attribute create path. |
| test/integration/fixtures/TestNodeBalancer_Create_WithBackendVPCOnly.yaml | Updates recorded POST body from vpcs to backend_vpcs (plus re-recorded fixture deltas). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ezilber-akamai
left a comment
There was a problem hiding this comment.
I get this error:
nodebalancers_test.go:143:
Error Trace: /Users/ezilber/Projects/dx-devenv/repos/linodego/test/integration/nodebalancers_test.go:566
/Users/ezilber/Projects/dx-devenv/repos/linodego/test/integration/nodebalancers_test.go:143
Error: Received unexpected error:
[400] [type] User doesn't have permissions to add the requested type of NodeBalancer
Test: TestNodeBalancer_Create_WithFrontendVPCOnly
Messages: Error listing nodebalancers, expected struct, got error [400] [type] User doesn't have permissions to add the requested type of NodeBalancer
despite having (I think) all required customer tags on my account.
Hi @ezilber-akamai , I have added you |
📝 Description
Changes related to the fact that "vpcs" attribute is deprecated (but still valid) in favor of "backend_vpcs" in POST /nodebalancers
✔️ How to Test
Without fixtures:
go test -count=1 ./test/integration/ -v -run TestNodeBalancer_Create_WithWith fixtures:
make test-int TEST_ARGS="-run TestNodeBalancer_Create_With"