(MOB) cleared up some tests

helped some repopulate tests, needed
refactoring for the clone_vm method
which broke its own tests. Yay
This commit is contained in:
kevpl 2018-07-24 11:05:50 -07:00
parent 6449f1aab1
commit 1c8728b9b2
No known key found for this signature in database
GPG key ID: A2791F7C6D6C0186
2 changed files with 12 additions and 17 deletions

View file

@ -3090,9 +3090,6 @@ EOT
---
:config:
task_limit: 10
:pools:
- name: #{pool}
size: #{pool_size}
EOT
)
}
@ -3113,28 +3110,28 @@ EOT
create_ready_vm(pool,vm,token)
expect(subject).to receive(:clone_vm).exactly(0).times
subject._check_pool(pool_object,provider)
subject.repopulate_pool_vms(pool, provider, pool_check_response, pool_size)
end
['ready','pending'].each do |queue_name|
it "should use VMs in #{queue_name} queue to caculate pool size" do
it "should use VMs in #{queue_name} queue to calculate pool size" do
expect(subject).to receive(:clone_vm).exactly(0).times
# Modify the pool size to 1 and add a VM in the queue
redis.sadd("vmpooler__#{queue_name}__#{pool}",vm)
config[:pools][0]['size'] = 1
pool_size = 1
subject._check_pool(pool_object,provider)
subject.repopulate_pool_vms(pool, provider, pool_check_response, pool_size)
end
end
['running','completed','discovered','migrating'].each do |queue_name|
it "should not use VMs in #{queue_name} queue to caculate pool size" do
it "should not use VMs in #{queue_name} queue to calculate pool size" do
expect(subject).to receive(:clone_vm)
# Modify the pool size to 1 and add a VM in the queue
redis.sadd("vmpooler__#{queue_name}__#{pool}",vm)
config[:pools][0]['size'] = 1
pool_size = 1
subject._check_pool(pool_object,provider)
subject.repopulate_pool_vms(pool, provider, pool_check_response, pool_size)
end
end