summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-03-07 16:59:34 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2019-03-07 16:59:34 -0800
commit7e977f343f6e82d86ce7d501647a32fbad65f22f (patch)
treea51fef6ad80e334ec841775a07f47946c3891326
parent21af0c448a4c9c987a42446dc89e29e56e042fdc (diff)
downloadchef-7e977f343f6e82d86ce7d501647a32fbad65f22f.tar.gz
fix sequencing
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--docs/dev/data_collector.md4
-rw-r--r--spec/unit/data_collector_spec.rb14
2 files changed, 10 insertions, 8 deletions
diff --git a/docs/dev/data_collector.md b/docs/dev/data_collector.md
index be597c12b6..73eba91826 100644
--- a/docs/dev/data_collector.md
+++ b/docs/dev/data_collector.md
@@ -64,11 +64,11 @@ As it happens in the actual chef-client run:
5. `events.node_load_success(node)`
6. `run_status.node = node`
* failures during run list expansion will cause `run_list_expand_failed(node, exception)` here and skip to #13
- * failures during cookbook resolution will cause `events.cookbook_resolution_failed(node, exception)` here and skip to #13
- * failures during cookbook synch will cause `events.cookbook_sync_failed(node, exception)` and skip to #13
7. `events.run_list_expanded(expansion)`
8. `run_status.start_clock`
9. `events.run_started(run_status)`
+ * failures during cookbook resolution will cause `events.cookbook_resolution_failed(node, exception)` here and skip to #13
+ * failures during cookbook synch will cause `events.cookbook_sync_failed(node, exception)` and skip to #13
10. `events.cookbook_compilation_start(run_context)`
11. < the resource events happen here which hit the action collection >
12. `events.converge_complete` or `events.converge_failed(exception)`
diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb
index 9d21b0ab85..154ab4681c 100644
--- a/spec/unit/data_collector_spec.rb
+++ b/spec/unit/data_collector_spec.rb
@@ -438,43 +438,45 @@ describe Chef::DataCollector do
it_behaves_like "sends a converge message"
end
- describe "when the run fails during run_list_expansion" do
+ describe "when the run fails during cookbook resolution" do
let(:exception) { Exception.new("imperial to metric conversion error") }
let(:error_description) { Chef::Formatters::ErrorMapper.cookbook_resolution_failed(node, exception).for_json }
let(:total_resource_count) { 0 }
let(:updated_resource_count) { 0 }
let(:status) { "failure" }
- let(:expected_expansion) { {} } # no run_list expanasion when it failed
let(:resource_record) { [] } # and no resources
before do
events.node_load_success(node)
run_status.node = node
+ events.run_list_expanded(expansion)
+ run_status.start_clock
+ expect_start_message
events.cookbook_resolution_failed(node, exception)
run_status.stop_clock
run_status.exception = exception
- expect_start_message
end
it_behaves_like "sends a converge message"
end
- describe "when the run fails during run_list_expansion" do
+ describe "when the run fails during cookbook synchronization" do
let(:exception) { Exception.new("imperial to metric conversion error") }
let(:error_description) { Chef::Formatters::ErrorMapper.cookbook_sync_failed(node, exception).for_json }
let(:total_resource_count) { 0 }
let(:updated_resource_count) { 0 }
let(:status) { "failure" }
- let(:expected_expansion) { {} } # no run_list expanasion when it failed
let(:resource_record) { [] } # and no resources
before do
events.node_load_success(node)
run_status.node = node
+ events.run_list_expanded(expansion)
+ run_status.start_clock
+ expect_start_message
events.cookbook_sync_failed(node, exception)
run_status.stop_clock
run_status.exception = exception
- expect_start_message
end
it_behaves_like "sends a converge message"