Skip to content

Commit ca5ebde

Browse files
committed
Add test for jq merge between dna.json and extra.json
Signed-off-by: Luca Carrogu <[email protected]>
1 parent 562e929 commit ca5ebde

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

recipes/tests.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,12 @@
8686
raise "cfn_node_type must be MasterServer or ComputeFleet"
8787
end
8888
end
89+
90+
bash 'execute jq' do
91+
cwd Chef::Config[:file_cache_path]
92+
code <<-JQMERGE
93+
echo '{"cfncluster": {"cfn_region": "eu-west-3"}, "run_list": "recipe[aws-parallelcluster::sge_config]"}' > /tmp/dna.json
94+
echo '{ "cfncluster" : { "ganglia_enabled" : "yes" } }' > /tmp/extra.json
95+
jq --argfile f1 /tmp/dna.json --argfile f2 /tmp/extra.json -n '$f1 + $f2 | .cfncluster = $f1.cfncluster + $f2.cfncluster' || exit 1
96+
JQMERGE
97+
end

0 commit comments

Comments
 (0)