Skip to content
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

Fix failing acceptance tests #100

Closed
holmesb opened this issue Dec 22, 2021 · 3 comments
Closed

Fix failing acceptance tests #100

holmesb opened this issue Dec 22, 2021 · 3 comments

Comments

@holmesb
Copy link
Contributor

holmesb commented Dec 22, 2021

make testacc has the following failures:
1.
=== CONT TestAccNetboxAvailablePrefix_multiplePrefixesSerial resource_netbox_available_prefix_test.go:92: Step 1/2 error: Error running apply: exit status 1

    Error: unexpected success response: content available as default response in error (status 204): {"Payload":null}

      with netbox_available_prefix.test2,
      on terraform_plugin_test.tf line 19, in resource "netbox_available_prefix" "test2":
      19: resource "netbox_available_prefix" "test2" {`

=== CONT TestAccNetboxAvailableIPAddress_basic resource_netbox_available_ip_address_test.go:18: Step 1/1 error: Check failed: Check 1/3 error: netbox_available_ip_address.test: Attribute 'ip_address' expected "1.1.2.1/24", got "1.1.2.2/24"

=== CONT TestAccNetboxAvailableIPAddress_multipleIpsSerial resource_netbox_available_ip_address_test.go:85: Step 1/1 error: Check failed: Check 1/3 error: netbox_available_ip_address.test1: Attribute 'ip_address' expected "1.1.4.1/24", got "1.1.4.5/24"

=== RUN TestAccNetboxAvailablePrefix_basic resource_netbox_available_prefix_test.go:42: Step 1/2 error: Check failed: Check 1/5 error: netbox_available_prefix.test: Attribute 'prefix' expected "1.1.0.0/25", got "1.1.0.128/25"

=== CONT TestAccNetboxVirtualMachinesDataSource_basic data_source_netbox_virtual_machines_test.go:15: Step 4/5 error: Check failed: Check 1/3 error: data.netbox_virtual_machines.test: Attribute 'vms.#' expected "2", got "7"

=== CONT TestAccNetboxInterfacesDataSource_basic data_source_netbox_interfaces_test.go:16: Step 4/4 error: Check failed: Check 1/2 error: data.netbox_interfaces.test: Attribute 'interfaces.#' expected "1", got "3"

@fbreckle
Copy link
Collaborator

I get a pass for make testacc and the pipelines are green, too. I think all of these are happening to you, because you do not have a fresh netbox data volume, i.e. there is some leftover data in there.

If, for example, the IP 1.1.2.1/24 is already taken in your local volume, the "next available ip" in the prefix 1.1.2.0/24 will be 1.1.2.2/24 instead of the expected value. (2-5)
If you have some old testing interfaces and virtual machines in your netbox, the number of things that will be found in the tests is bigger than expected. (5-6)

Can you check if you have a similar problem with 1.?

@holmesb
Copy link
Contributor Author

holmesb commented Dec 23, 2021

Yes passing now thanks, I've added a note to the readme explaining how to housekeep stale netbox data volumes

@fbreckle
Copy link
Collaborator

Closed by #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants