mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
5 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e6613d56a0 |
Update migration spec to call pool manager and validate results
Use mock_redis instead of redis. Make passing of mock redis to helper calls more clear Update pool_manager_spec to specify vsphere argument where applicable. Update pool_helper calls to vsphere where needed for tests to pass. Without this change rspec tests for pool_manager_spec exhibit 12 failures. Update pool_manager_spec test with open_socket Pool_manager_spec stubs a tcpsocket connection to simulate this happening directly within _check_pending_vm. This commit updates this to look more like its usage with open_socket, which allows the test to pass. |
||
|
|
30dc060731 |
[QENG-4181] Add per-pool stats to /status API
Prior to this the only per-pool statistics that could be extracted from the API
were a list of empty pools in the "status" section of the returned results of
the `/status` endpoint.
This adds a new "pools" section to the '/status' results which lists, for each
pool, the following results:
- The number of ready vms in the pool
- The number of running vms in the pool
- The number of pending vms in the pool
- The maximum size of the pool (as specified in the vmpooler configuration)
Example:
```
{
"boot": {
"duration": {
"average": 163.6,
"min": 65.49,
"max": 830.07,
"total": 247744.71000000002
},
"count": {
"total": 1514
}
# ...
"pools": {
"pool1": {
"ready": 5,
"running": 2,
"pending": 1,
"max": 15
},
"pool2": {
"ready": 0,
"running": 10,
"pending": 0,
"max: 10
}
}
}
```
This includes spec coverage for this change (we could use more specs on `/status` in general); as well as a couple of general spec improvements.
|
||
|
|
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 |
||
|
|
2d514f53bf | Use expect_json helper method for determining JSON response status |