diff options
author | Adam Leff <adam@leff.co> | 2016-06-28 11:24:23 -0400 |
---|---|---|
committer | Adam Leff <adam@leff.co> | 2016-06-28 16:02:41 -0400 |
commit | 3f6db5dc96b5ecb552a491e77730356e8df2021d (patch) | |
tree | 1ab2389d92d013ac83f7b0919c175f17a9a8eeaf /spec | |
parent | 945f23be7a43d90ae7ed402d05363b3ff0c11bff (diff) | |
download | chef-3f6db5dc96b5ecb552a491e77730356e8df2021d.tar.gz |
Adding node object to run_converge message, include ignore_failure property
Many use cases that involve consuming the run_converge messages and
displaying them to end users include needing additional data about
the node that generated the run_converge message. This change
consolidates the run_converge and node_update message into a single
message making it easier for users to filter run_converge messages
based on attributes and criteria of the node itself.
Additionally, the ignore_failure property on a resource is now
included for each resource in the resource list so end users can
decided whether the failure was a hard failure or a soft failure.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/data_collector/messages_spec.rb | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/spec/unit/data_collector/messages_spec.rb b/spec/unit/data_collector/messages_spec.rb index 686e500507..24d225a1fe 100644 --- a/spec/unit/data_collector/messages_spec.rb +++ b/spec/unit/data_collector/messages_spec.rb @@ -86,6 +86,7 @@ describe Chef::DataCollector::Messages do expanded_run_list message_type message_version + node node_name organization_name resources @@ -136,6 +137,7 @@ describe Chef::DataCollector::Messages do expanded_run_list message_type message_version + node node_name organization_name resources @@ -169,46 +171,4 @@ describe Chef::DataCollector::Messages do end end end - - describe '#node_update_message' do - let(:run_status) { Chef::RunStatus.new(Chef::Node.new, Chef::EventDispatch::Dispatcher.new) } - - let(:required_fields) do - %w{ - entity_name - entity_type - entity_uuid - id - message_type - message_version - organization_name - recorded_at - remote_hostname - requestor_name - requestor_type - run_id - service_hostname - source - task - user_agent - } - end - let(:optional_fields) { %w{data} } - - it "is not missing any required fields" do - missing_fields = required_fields.select do |key| - !Chef::DataCollector::Messages.node_update_message(run_status).key?(key) - end - - expect(missing_fields).to eq([]) - end - - it "does not have any extra fields" do - extra_fields = Chef::DataCollector::Messages.node_update_message(run_status).keys.select do |key| - !required_fields.include?(key) && !optional_fields.include?(key) - end - - expect(extra_fields).to eq([]) - end - end end |