Put back passthrough automate reporter output.

Signed-off-by: Alexander Stein <astein@flexion.us>
This commit is contained in:
Alexander Stein 2021-03-15 13:16:03 -04:00
parent 6748c1d704
commit 351a943b35
2 changed files with 11 additions and 1 deletions

View file

@ -25,7 +25,7 @@ module Inspec::Reporters
}
# optional jsonconfig passthrough options
%w{node_name environment roles job_uuid}.each do |option|
%w{node_name environment roles job_uuid passthrough}.each do |option|
output[option.to_sym] = @config[option] unless @config[option].nil?
end
output

View file

@ -55,6 +55,10 @@ describe "inspec exec automate" do
"job_uuid": "test123",
"roles": ["stuff"],
"environment": "prod",
"passthrough": {
"projects": ["alpha", "beta"],
"another_tramp_datum": "another_value"
},
"node_name": "some_node"
}
}
@ -74,6 +78,7 @@ describe "inspec exec automate" do
node_name
job_uuid
environment
passthrough
roles
}.each do |field|
_(json.keys).must_include field
@ -86,6 +91,11 @@ describe "inspec exec automate" do
_(json.keys).wont_include field
end
# Added in InSpec v3.7.11+
_(json.keys).must_include "passthrough"
_(json["passthrough"].keys.sort).must_equal %w{another_tramp_datum projects}
_(json["passthrough"]["projects"]).must_equal %w{alpha beta}
assert_exit_code 0, run_result
end
end