Skip to content

Commit ad4fe59

Browse files
committed
Skip test for custom AMI
Skip test if jq is not installed, because for custom ami it is installed during bootstrap time (inside cloudformation userdata) Signed-off-by: Luca Carrogu <carrogu@amazon.com>
1 parent 0d95ba0 commit ad4fe59

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

.kitchen.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ suites:
6969
cfn_shared_dir: <%= ENV['CFN_SHARED_DIR'] %>
7070
cfn_cluster_user: <%= ENV['CFN_CLUSTER_USER'] %>
7171
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
72+
os: <%= ENV['OS'] %>
7273

7374
- name: sge_config_MasterServer
7475
run_list:
@@ -89,6 +90,7 @@ suites:
8990
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
9091
cfn_ddb_table: <%= ENV['CFN_DDB_TABLE'] %>
9192
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
93+
os: <%= ENV['OS'] %>
9294

9395
- name: torque_config_MasterServer
9496
run_list:
@@ -109,6 +111,7 @@ suites:
109111
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
110112
cfn_ddb_table: <%= ENV['CFN_DDB_TABLE'] %>
111113
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
114+
os: <%= ENV['OS'] %>
112115

113116
- name: slurm_config_MasterServer
114117
run_list:
@@ -129,6 +132,7 @@ suites:
129132
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
130133
cfn_ddb_table: <%= ENV['CFN_DDB_TABLE'] %>
131134
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
135+
os: <%= ENV['OS'] %>
132136

133137
- name: sge_config_ComputeFleet
134138
run_list:
@@ -149,6 +153,7 @@ suites:
149153
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
150154
cfn_master: <%= ENV['CFN_MASTER'] %>
151155
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
156+
os: <%= ENV['OS'] %>
152157

153158
- name: torque_config_ComputeFleet
154159
run_list:
@@ -169,6 +174,7 @@ suites:
169174
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
170175
cfn_master: <%= ENV['CFN_MASTER'] %>
171176
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
177+
os: <%= ENV['OS'] %>
172178

173179
- name: slurm_config_ComputeFleet
174180
run_list:
@@ -189,3 +195,4 @@ suites:
189195
cfn_sqs_queue: <%= ENV['CFN_SQS_QUEUE'] %>
190196
cfn_master: <%= ENV['CFN_MASTER'] %>
191197
custom_node_package: <%= ENV['PARALLELCLUSTER_NODE_URL'] %>
198+
os: <%= ENV['OS'] %>

recipes/tests.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@
9999
end
100100
end
101101

102-
bash 'execute jq' do
103-
cwd Chef::Config[:file_cache_path]
104-
code <<-JQMERGE
105-
# Set PATH as in the UserData script of the CloudFormation template
106-
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin"
107-
echo '{"cfncluster": {"cfn_region": "eu-west-3"}, "run_list": "recipe[aws-parallelcluster::sge_config]"}' > /tmp/dna.json
108-
echo '{ "cfncluster" : { "ganglia_enabled" : "yes" } }' > /tmp/extra.json
109-
jq --argfile f1 /tmp/dna.json --argfile f2 /tmp/extra.json -n '$f1 + $f2 | .cfncluster = $f1.cfncluster + $f2.cfncluster' || exit 1
110-
JQMERGE
102+
unless node['cfncluster']['os'].end_with?("-custom")
103+
bash 'execute jq' do
104+
cwd Chef::Config[:file_cache_path]
105+
code <<-JQMERGE
106+
# Set PATH as in the UserData script of the CloudFormation template
107+
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin"
108+
echo '{"cfncluster": {"cfn_region": "eu-west-3"}, "run_list": "recipe[aws-parallelcluster::sge_config]"}' > /tmp/dna.json
109+
echo '{ "cfncluster" : { "ganglia_enabled" : "yes" } }' > /tmp/extra.json
110+
jq --argfile f1 /tmp/dna.json --argfile f2 /tmp/extra.json -n '$f1 + $f2 | .cfncluster = $f1.cfncluster + $f2.cfncluster' || exit 1
111+
JQMERGE
112+
end
111113
end

0 commit comments

Comments
 (0)