Skip to content

Commit 02ff54a

Browse files
committed
[ecloud] Fixes tests by duplicating test setup
In order to have two different groups of server tests the ecloud tests are in two sets within the one file - which explains the setup outside of the Shindo block. Shindo's tags do not work when nested so this fixes the problem by duplicating the test setup in the second group of tests. Fog::Compute can't safely sit outside the top Shindo block so the duplication is preferable to breaking all/ecloud tests. Also corrected the missing provider tag in this second set so the "attributes" tests do not run when should be filtered by tags.
1 parent b7b7f51 commit 02ff54a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/ecloud/compute/models/server_tests.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@
127127
end
128128
end
129129

130-
Shindo.tests("Fog::Compute[:#{provider}] | server", "attributes") do
130+
Shindo.tests("Fog::Compute[:#{provider}] | server", [provider.to_s, "attributes"]) do
131+
connection = Fog::Compute[provider]
132+
organization = connection.organizations.first
133+
environment = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
134+
public_ip = environment.public_ips.first
135+
compute_pool = environment.compute_pools.first
136+
image_href = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
137+
ssh_key = organization.admin.ssh_keys.detect { |key| key.name == "root" }
138+
131139
@network = environment.networks.first
132140
options = config[:server_attributes].merge(:network_uri => @network.href, :ssh_key_uri => ssh_key.href)
133141
#if Fog.credentials[:ecloud_ssh_key_id]

0 commit comments

Comments
 (0)