mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
3 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8bcf74872a |
(POOLER-73) Restructure tests to unit and integration directories
Previously all of the spec tests for VM Pooler were all together in the specs directory. However some tests require a working local Redis server to operate and other instead mock all external dependencies. This commit splits the test files between unit and integration, where integration tests require a working Redis instance, and unit tests do not. This commit also removes the root `vmpooler` directory as it is not required. The tests rake test still operates correctly. This commit also adds the mock_redis library for testing for the pool_manager. |
||
|
|
34b93ca6c3 |
Merge CI.next into Master (#161)
* [QENG-3919] Make vmpooler checkouts be all or nothing (#153) * (QENG-3919) spike for implementation of all-or-nothing checkout * Fix two botched variable references * Aggregate API helper methods * Add specs for failed multi-vm allocation API endpoints * (QENG-3919) Add tests for multiple vm requests * (QENG-3919) Add (failing) specs for POST /vm/pool1+pool2 usages This exposes the old (bad) behavior on this other code path. Will fix this up next. * (QENG-3919) Bring query params version in line with JSON post version Not clear to me why these had to be implemented so differently. * (QENG-3919) extract common method from both methods of VM allocation * (QENG-3919) Naming fix, cosmetic cleanups I mean, I presume all these commits are going to get squashed away on merge anyway. * (QENG-3919) Update API docs We consider it a bug that the actual behavior was not this behavior, but the documentation was also silent on this point. * (QENG-3919) minor readability tweak in refactored method * (QENG-3919) Clean up interim comments re: status codes * (QENG-3919) Drop now-orphaned `checkout_vm` method We kept this up-to-date while we were upgrading and refactoring, but, turns out, this method is no longer called anywhere. 💀 🔥 * (QENG-3919) Return 503 status on failed allocation Making sure we go back to the original functionality, which was: - status 200 when vms successfully allocated - status 404 when a pool name is unknown - status 404 when no pool name is specified - status 503 when vm allocation failed * (QENG-3919) add net-ldap to Gemfile Maybe we shouldn't foil-ball gems onto servers. * (QENG-3919) Turns out, spush isn't a redis command And hence we see once again the weakness of mockist tests. * (QENG-3919) Pin the net-ldap gem to 0.11 for the jrubies, etc. * (QENG-3919) Correct an old spelling error in spec descriptions * (QENG-3919) Further tweak net-ldap version * (QENG-3919) return_single_vm -> return_vm_to_ready_state cc @shermdog * (RE-7014) Add support for statsd They way we were using graphite was incorrect for the type of data we were sending it. statsd is the appropriate mechanism for our needs. statsd and graphite are mutually exclusive and configuring statsd will take precendence over Graphite. Example of configuration in vmpooler.yaml.example * (RE-7014) Add tracking of vm gets via statsd Add the tracking of successful, failed, invalid, and empty pool vm gets. It is possible we may want to tweak this, but have validated with spec tests and pcaps. ``` vmpooler-tmp-dev.ready.debian-7-x86_64:1|c vmpooler-tmp-dev.running.debian-7-x86_64:1|c vmpooler-tmp-dev.checkout.invalid:1|c vmpooler-tmp-dev.checkout.success.debian-7-x86_64:1|c vmpooler-tmp-dev.checkout.empty:1|c vmpooler-tmp-dev.running.debian-7-x86_64:1|c vmpooler-tmp-dev.clone.debian-7-x86_64:12.10|ms vmpooler-tmp-dev.ready.debian-7-x86_64:1|c ``` * (RE-7014) statsd nitpicks and additional rspec Cleaned up some code review nitpicks and added pool_manager_spec for empty pool. * (RE-7014) update statsd to use gauge for running/ready Previously was using increment which was incorrect for that particular application. * Revert "Merge pull request #155 from shermdog/RE-7014-cinext" This reverts commit |
||
|
|
26ca390b4c |
Improved tests for vmpooler (#152)
* Add redis to our travis runs * De-mockistify v1/token specs; use real redis. Open questions: - Do we need to do better cleanup here? - Should we be using a separate database to prevent clobbering other local db's? * Remove mockist tests from main suite. * (MAINT) gitignore some common files * (maint) Clean up some of the /vm/ tests * (maint) Convert specs for /vm/template * (maint) Clean up, reorganize specs * (maint) Move extracted spec helper methods to spec_helper * (maint) rename create_vm -> create_ready_vm * (WIP) add partially-converted /vm/hostname specs * (maint) clean up vm_spec * (WIP) notes for next steps * (maint) Define :config in token tests Miscellaneous whitespace cleanup. * (maint) Lift #redis definition into spec helper library * (maint) drop unneeded clear_pool helper Given the way we're flushing redis (which seems super performant), we don't need to clear pools any more at the beginning of tests. * (maint) Drop clear_pool from vm/template specs * (maint) Update vm/hostname tag and lifetime specs * (maint) Convert vm deletion specs * (maint) Convert specs for vm snapshot operations * (maint) Drop now-obsolete v1_spec.rb * (maint) cosmetic cleanup in spec helper * (maint) begin de-mockistifying api_spec.rb * (maint) repair incorrect test The mockist version of the test allows redis' scard to return nil, which it does not actually do in real life. Verified the behavior in the code via a debugger. Fixed the test. * (maint) finish converting dashboard specs * (maint) rename api_spec to dashboard_spec * (maint) Don't clobber default redis database when running specs |