-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Migrate gateways command from packngo to metal-go client #376
Conversation
Add tests for gateway subcommand Signed-off-by: Ayush Rangwala <[email protected]>
Signed-off-by: Ayush Rangwala <[email protected]>
|
|
I think SetupDeviceAndProject may need to |
We should also be calling t.Helper() in metal-cli/test/helper/helper.go Line 308 in 4b87ce6
|
it was kept with t.Errorf(err) because I wanted to make the |
Signed-off-by: Ayush Rangwala <[email protected]>
@displague @ctreatma Please trigger E2E tests |
test/e2e/gateways/create_test.go
Outdated
rootClient := root.NewClient(consumerToken, apiURL, Version) | ||
|
||
device, err := helper.SetupProjectAndDevice(t, &projectId, &deviceId) | ||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use t.Cleanup()
refer here
@@ -72,6 +72,27 @@ func CreateTestVLAN(projectId string) (*openapiclient.VirtualNetwork, error) { | |||
return vlan, nil | |||
} | |||
|
|||
func CreateTestGateway(projectId, vlanId string, privateIPv4SubnetSize *int32) (*openapiclient.MetalGateway, error) { | |||
TestApiClient := TestClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the Helpers in this file needs to call t.Helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle that under a separate Issue and PR
Signed-off-by: Ayush Rangwala <[email protected]>
Signed-off-by: Ayush Rangwala <[email protected]>
Ran the tests locally for gateway and its running fine ❯ go test ./test/e2e/gateways
ok github.com/equinix/metal-cli/test/e2e/gateways 377.900s |
Signed-off-by: Ayush Rangwala <[email protected]>
29dc3d0
to
937c467
Compare
970c25d
to
ab368df
Compare
ab368df
to
3b01e6a
Compare
3b01e6a
to
937c467
Compare
@ctreatma E2E tests failed but with a device test related error
All the ports, gateway tests are passing |
I re-ran the tests a few times to try to get a passing run again, but couldn't. That's a bit concerning, but outside the scope of this PR, so this is fine to merge. |
Issue Task as part of migrating metal-cli from packngo to metal-go client, added the support of gateways subcommand to use metal-go
Fixes: #333