-
Notifications
You must be signed in to change notification settings - Fork 38
chore(iaas): fix acc tests #1059
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
base: main
Are you sure you want to change the base?
Conversation
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
| resource.TestCheckResourceAttrPair( | ||
| "stackit_public_ip.public_ip_simple", "network_interface_id", | ||
| "stackit_network_interface.network_interface_simple", "network_interface_id", | ||
| ), | ||
| // The network gets re-created, which triggers a re-create of the 'network_interface_simple' NIC, which leads the 'stackit_public_ip_associate' resource to update the | ||
| // networkInterfaceId of the public IP. All that without the public ip resource noticing. So the public ip resource will still hold the networkInterfaceId of the old NIC. | ||
| // So we can only check that *some* network interface ID is set here, but can't compare it with the networkInterfaceId of the NIC resource (old vs. new NIC id) | ||
| resource.TestCheckResourceAttrSet("stackit_public_ip.public_ip_simple", "network_interface_id"), |
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.
No blame on you, this test case was the last time changed by me, so probably I mixed up something.
I think we should adjust the tests, to prevent the recreation of the network interfaces. Actually not to prevent the error you commented, but to test the intended case here is. This would be in my opinion, to check if the Update function of network interface works as expected.
terraform-provider-stackit/stackit/internal/services/iaas/networkinterface/resource.go
Line 340 in 52b879b
| func (r *networkInterfaceResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform |
With the current test cases, the update function isn't covered in the tests
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)