mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
Fixed remove_excess_vms test
This commit is contained in:
parent
0126c305ec
commit
1890344d7d
2 changed files with 21 additions and 20 deletions
|
|
@ -3215,21 +3215,6 @@ EOT
|
|||
# end
|
||||
end
|
||||
|
||||
context 'when an excess number of ready vms exist' do
|
||||
|
||||
before(:each) do
|
||||
allow(redis).to receive(:scard)
|
||||
expect(redis).to receive(:scard).with("vmpooler__ready__#{pool}").and_return(1)
|
||||
expect(redis).to receive(:scard).with("vmpooler__pending__#{pool}").and_return(1)
|
||||
end
|
||||
|
||||
it 'should call remove_excess_vms' do
|
||||
expect(subject).to receive(:remove_excess_vms).with(config[:pools][0], provider, 1, 2)
|
||||
|
||||
subject._check_pool(config[:pools][0],provider)
|
||||
end
|
||||
end
|
||||
|
||||
context 'export metrics' do
|
||||
it 'increments metrics for ready queue' do
|
||||
create_ready_vm(pool,'vm1')
|
||||
|
|
@ -3557,6 +3542,23 @@ EOT
|
|||
end
|
||||
end
|
||||
|
||||
#remove_excess_vms
|
||||
context 'when an excess number of ready vms exist' do
|
||||
|
||||
before(:each) do
|
||||
allow(redis).to receive(:scard)
|
||||
expect(redis).to receive(:scard).with("vmpooler__ready__#{pool}").and_return(1)
|
||||
expect(redis).to receive(:scard).with("vmpooler__pending__#{pool}").and_return(1)
|
||||
end
|
||||
|
||||
it 'should call remove_excess_vms' do
|
||||
allow(subject).to receive(:create_inventory).and_return({})
|
||||
expect(subject).to receive(:remove_excess_vms).with(config[:pools][0])
|
||||
|
||||
subject._check_pool(config[:pools][0],provider)
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue