Skip to content

Commit

Permalink
Fix ansible playbook workflow specs
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Mar 17, 2020
1 parent 76ac969 commit 17d4194
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/models/manageiq/providers/ansible_playbook_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
context "with playbook_path" do
it "succeeds" do
expect_any_instance_of(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource).to_not receive(:checkout_git_repository)
expect(job).to receive(:queue_signal).with(:execute)
expect(job).to receive(:queue_signal).with(:execute, :deliver_on => nil)

job.signal(:pre_execute)

Expand All @@ -122,7 +122,7 @@

it "will checkout the git repository to a temp dir before proceeding" do
expect_any_instance_of(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource).to receive(:checkout_git_repository)
expect(job).to receive(:queue_signal).with(:execute)
expect(job).to receive(:queue_signal).with(:execute, :deliver_on => nil)

job.signal(:pre_execute)

Expand Down Expand Up @@ -181,7 +181,7 @@
]

expect(Ansible::Runner).to receive(:run_async).with(*runner_options).and_return(response_async)
expect(job).to receive(:queue_signal).with(:poll_runner)
expect(job).to receive(:queue_signal).with(:poll_runner, :deliver_on => nil)

job.signal(:execute)

Expand All @@ -190,7 +190,7 @@

it "ansible-runner fails" do
expect(Ansible::Runner).to receive(:run_async).and_return(nil)
expect(job).to receive(:queue_signal).with(:abort, "Failed to run ansible playbook", "error")
expect(job).to receive(:queue_signal).with(:abort, "Failed to run ansible playbook", "error", :deliver_on => nil)

job.signal(:execute)
end
Expand All @@ -213,7 +213,7 @@

response = Ansible::Runner::Response.new(response_async.dump.merge(:return_code => 0))
expect(response_async).to receive(:response).and_return(response)
expect(job).to receive(:queue_signal).with(:post_execute)
expect(job).to receive(:queue_signal).with(:post_execute, :deliver_on => nil)

job.signal(:poll_runner)
end
Expand All @@ -233,7 +233,7 @@
Timecop.travel(time) do
expect(response_async).to receive(:running?).and_return(true)
expect(response_async).to receive(:stop)
expect(job).to receive(:queue_signal).with(:abort, "ansible playbook has been running longer than timeout", "error")
expect(job).to receive(:queue_signal).with(:abort, "ansible playbook has been running longer than timeout", "error", :deliver_on => nil)

job.signal(:poll_runner)
end
Expand Down

0 comments on commit 17d4194

Please sign in to comment.