(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.
This commit is contained in:
Rick Bradley 2016-06-01 14:55:10 -05:00
parent ea9fd004d6
commit 2fcd639882
2 changed files with 0 additions and 14 deletions

View file

@ -39,9 +39,3 @@ end
def fetch_vm(vm) def fetch_vm(vm)
redis.hgetall("vmpooler__vm__#{vm}") redis.hgetall("vmpooler__vm__#{vm}")
end end
def clear_pool(pool)
['ready'].each do |state| # TODO add more states if desired
redis.del("vmpooler__#{state}__#{pool}")
end
end

View file

@ -48,7 +48,6 @@ describe Vmpooler::API::V1 do
describe 'POST /vm' do describe 'POST /vm' do
it 'returns a single VM' do it 'returns a single VM' do
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
post "#{prefix}/vm", '{"pool1":"1"}' post "#{prefix}/vm", '{"pool1":"1"}'
@ -65,7 +64,6 @@ describe Vmpooler::API::V1 do
end end
it 'returns a single VM for an alias' do it 'returns a single VM for an alias' do
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
post "#{prefix}/vm", '{"poolone":"1"}' post "#{prefix}/vm", '{"poolone":"1"}'
@ -82,14 +80,11 @@ describe Vmpooler::API::V1 do
end end
it 'fails on nonexistant pools' do it 'fails on nonexistant pools' do
clear_pool 'poolpoolpool'
post "#{prefix}/vm", '{"poolpoolpool":"1"}' post "#{prefix}/vm", '{"poolpoolpool":"1"}'
expect_json(ok = false, http = 404) expect_json(ok = false, http = 404)
end end
it 'returns multiple VMs' do it 'returns multiple VMs' do
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
create_ready_vm 'pool2', 'qrstuvwxyz012345' create_ready_vm 'pool2', 'qrstuvwxyz012345'
@ -113,7 +108,6 @@ describe Vmpooler::API::V1 do
it 'does not extend VM lifetime if auth token is provided' do it 'does not extend VM lifetime if auth token is provided' do
app.settings.set :config, auth: false app.settings.set :config, auth: false
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
post "#{prefix}/vm", '{"pool1":"1"}', { post "#{prefix}/vm", '{"pool1":"1"}', {
@ -138,7 +132,6 @@ describe Vmpooler::API::V1 do
it 'extends VM lifetime if auth token is provided' do it 'extends VM lifetime if auth token is provided' do
app.settings.set :config, auth: true app.settings.set :config, auth: true
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
post "#{prefix}/vm", '{"pool1":"1"}', { post "#{prefix}/vm", '{"pool1":"1"}', {
@ -160,7 +153,6 @@ describe Vmpooler::API::V1 do
it 'does not extend VM lifetime if auth token is not provided' do it 'does not extend VM lifetime if auth token is not provided' do
app.settings.set :config, auth: true app.settings.set :config, auth: true
clear_pool 'pool1'
create_ready_vm 'pool1', 'abcdefghijklmnop' create_ready_vm 'pool1', 'abcdefghijklmnop'
post "#{prefix}/vm", '{"pool1":"1"}' post "#{prefix}/vm", '{"pool1":"1"}'