Skip to content

Commit 2b8ecc1

Browse files
committed
[Isolated] Test python pacakges are installed when in an ADC region
1 parent 11d4703 commit 2b8ecc1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

cookbooks/aws-parallelcluster-platform/spec/unit/recipes/cookbook_virtualenv_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
cached(:virtualenv_path) { 'system_pyenv_root/versions/python_version/envs/cookbook_virtualenv' }
99
cached(:aws_region) { 'us-iso-test' }
1010

11-
before do
12-
allow_any_instance_of(String).to receive(:start_with?).with("us-iso").and_return(true)
13-
end
14-
15-
1611
context "when cookbook virtualenv not installed yet" do
1712
cached(:chef_run) do
1813
runner = runner(platform: platform, version: version) do |node|
@@ -38,13 +33,18 @@
3833
expect(node.default['cluster']['cookbook_virtualenv_path']).to eq(virtualenv_path)
3934
is_expected.to write_node_attributes('dump node attributes')
4035
end
36+
context "when in isolated region" do
37+
before do
38+
allow_any_instance_of(String).to receive(:start_with?).with("us-iso").and_return(true)
39+
end
4140

42-
it 'installs python packages' do
43-
is_expected.to run_bash("pip install").with(
44-
user: 'root',
45-
group: 'root',
46-
cwd: "#{node['cluster']['base_dir']}"
47-
).with_code(/tar xzf cookbook-dependencies.tgz/)
41+
it 'installs python packages' do
42+
is_expected.to run_bash("pip install").with(
43+
user: 'root',
44+
group: 'root',
45+
cwd: "#{node['cluster']['base_dir']}"
46+
).with_code(/tar xzf cookbook-dependencies.tgz/)
47+
end
4848
end
4949
end
5050
end

0 commit comments

Comments
 (0)