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

Compute Acceptance Test Fixes #8

Merged
merged 19 commits into from
Jul 26, 2016

Conversation

jtopjian
Copy link
Contributor

This PR enables individual compute acceptance tests to be run. Only a few acceptance tests are passing at this time, however, these changes are required for Go to validate the acceptance/openstack/compute/v2 package.

For #6

@coveralls
Copy link

coveralls commented Jul 13, 2016

Coverage Status

Coverage remained the same at 89.876% when pulling 437a5fd on jtopjian:compute-acc-fixes into 6fb9d11 on gophercloud:master.

@jtopjian
Copy link
Contributor Author

@jrperritt No doubt I'm jumping the gun on getting fixes/changes into this new repo, so please feel free to nit (or nix) all of this.

I began going through the compute acceptance tests and thought about compiling them all into one large PR, but it looks like that would be one very large PR. In addition, some of the test failures might require changes to the corresponding packages (see #7). So I thought I'd start with this which at least allows individual tests to be run.

@jtopjian jtopjian changed the title [wip] Compute Acceptance Test Fixes Compute Acceptance Test Fixes Jul 13, 2016
@jtopjian jtopjian changed the title Compute Acceptance Test Fixes [wip] Compute Acceptance Test Fixes Jul 24, 2016
@jtopjian
Copy link
Contributor Author

@jrperritt Curiosity is getting the best of me and I've started going through each of the Compute acceptance tests to see what fixes they need or how I can practice cleaning them up. I have each of the above tests also in separate branches if that would be easier, but some require a few common fixes. I can look at making each branch completely standalone, though.

defer func() {
servers.Delete(client, server.ID)
t.Logf("Server deleted.")
}()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the delete defer to be triggered after the instance has been confirmed ACTIVE. This is so if instance creation fails, the error'd instance still remains so the tester can investigate why the instance failed to launch. When defer was in its original location, the instance would immediately be deleted, the UUID never printed (though this can be fixed), and troubleshooting was much harder.

@jtopjian jtopjian force-pushed the compute-acc-fixes branch 3 times, most recently from d5b244a to 49f9007 Compare July 25, 2016 16:45
@jrperritt
Copy link
Contributor

As far as I'm concerned, you can't make the acceptance tests any worse than they were before this PR. Because of that, As long as you're only touching the acceptance tests (or docs), I'm not concerned about reviewing this (and therefore not concerned about the size of it). Once you're happy with it (and it builds), let me know and I'll merge it.

@jtopjian
Copy link
Contributor Author

As far as I'm concerned, you can't make the acceptance tests any worse than they were before this PR.

I'm gonna take that as a compliment :D

Sounds good. This has been pretty fun and a good way for me to determine what needs to be (or can be, for the better) changed in Terraform.

@jrperritt
Copy link
Contributor

I'm gonna take that as a compliment :D

It was, and a slight to myself.

@jtopjian jtopjian force-pushed the compute-acc-fixes branch 2 times, most recently from 8df0cb1 to 260f698 Compare July 26, 2016 02:52
@coveralls
Copy link

coveralls commented Jul 26, 2016

Coverage Status

Coverage remained the same at 89.876% when pulling 260f698 on jtopjian:compute-acc-fixes into 4b4827b on gophercloud:master.

@jtopjian jtopjian changed the title [wip] Compute Acceptance Test Fixes Compute Acceptance Test Fixes Jul 26, 2016
@jtopjian
Copy link
Contributor Author

@jrperritt I think this is ready to go!

There are probably a few nits here and there and I wasn't able to successfully run the defsecrules tests due to that extension requiring a custom environment, but other than that, everything runs great!

Let me know if you have any questions.

@@ -0,0 +1,153 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean for this to be committed, and, if so, can you comment on what it does? Something like # Installs keylogger would suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, meant to commit it, but oops on not having any useful comments.

@jrperritt
Copy link
Contributor

Can you merge or rebase with master? After that and that ^, this looks good to merge.

The following changes were made to the common compute acc test functions:

* Check for Instances in ERROR state to immediately return.
* Making OS_POOL_NAME required.
* Added identity client function.
* Added block storage client function.
* Making "private" the default OS_NETWORK_NAME.
The following changes were made to the flavor acceptance test:

* Renamed tests so tests can selectively be run by substring
* Reading all returned pages at once.
* Modified test output.
* Printing all flavor attributes.
The following changes were made to the image acceptance test:

* Added test to get a single image.
* Renamed tests so tests can selectively be run by substring
* Reading all returned pages at once.
* Modified test output.
* Printing all image attributes.
The following changes were made to the servers acceptance tests:

* Renamed tests so tests can selectively be run by substring.
* Reading all returned pages at once.
* Modified test output.
* Printing all server attributes in output.
* Consistently place and log server deletion.
* Fixed occurrences of wrong error variable being reported.
* Removed invalid resize error.
* Implemented RebootOpts in order to test server reboot.
The following changes were made to the servergroups acceptance tests:

* Renamed servers to servergroups in build tag
* Renamed tests so tests can selectively be run by substring.
* Modified test output.
* Printing all servergroups attributes.
The following changes were made to the keypairs acceptance tests:

* Added build tags.
* Added List test.
* Added Create test.
* Added Import test.
* Cleaned up Server Create test.
* Printing all keypairs attributes.
The following changes were made to the security groups acceptance tests:

* Created List test.
* Broke out Create, Update, and Rule tests.
* Printing all security group attributes.
* Renamed AddServerToGroup to AddServer.
* Renamed RemoveServerFromGroup to RemoveServer.
The following changes were made to the floating IPs acceptance test:

* Renamed package floatingip to floatingips.
* Created List test.
* Broke out Create, Associate, and Associate Fixed IP tests.
* Removed deprecated associate tests.
* Printing all floating IP attributes.
The following changes were made to the tenant networks acceptance tests:

* Created List test.
* Created Get test.
* Removed server test.
* Printing all tenant network attributes.
The following changes were made to the networks acceptance tests:

* Created List test.
* Created Get test.
* Removed server test.
* Printing all network attributes.
The following changes were made to the extensions acceptance tests:

* Retrieving all extensions with all pages.
* Fixed build tag.
* Renamed tests so tests can selectively be run by substring.
* Printing all extension attributes.
The following changes were made to the quota sets acceptance tests:

* Added build tag.
* Renamed tests so tests can selectively be run by substring.
* Now obtaining identityclient via common compute acctest function.
The following changes were made to the defsecrules acceptance tests:

* Renamed tests so tests can selectively be run by substring.
* Retrieving lists with all pages.
* Renamed test file.
* Printing all default rule attributes.
The following changes were made to the bootfromvolume acceptance tests:

* Renamed tests so tests can selectively be run by substring.
* Created createBootFromVolumeServer function
The following changes were amde to the volumeattach acceptance tests:

* Added build tag.
* Obtaining block storage client from common function.
* Printing all volume attachment attributes.
* Removed Rackspace-specific environment variables.
* Added OS_POOL_NAME environment variable.
* Added OS_NETWORK_NAME environment variable.
* Added bash function for test shortcuts.
* Added notes about compute tests.
This script will install devstack and Go within a virtual machine.
Devstack is configured with the current API versions of all
OpenStack services except for Keystone (v2) and LBaaS (v1).
@jtopjian
Copy link
Contributor Author

@jrperritt Done and done.

@coveralls
Copy link

coveralls commented Jul 26, 2016

Coverage Status

Coverage remained the same at 89.876% when pulling e361ee8 on jtopjian:compute-acc-fixes into b1ac8fd on gophercloud:master.

@jrperritt
Copy link
Contributor

Thank you for all the work on this. +2

@jrperritt jrperritt merged commit 6b427a5 into gophercloud:master Jul 26, 2016
@jtopjian
Copy link
Contributor Author

Thank you for all the work on this.

No problem at all. I'll probably go through a few of the others that I'm familiar with (block storage, networking).

@jtopjian jtopjian deleted the compute-acc-fixes branch March 23, 2017 16:04
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

Successfully merging this pull request may close these issues.

None yet

3 participants