Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show vro failure logs in kitchen #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/kitchen/driver/vro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def execute_create_workflow(state)
execute_workflow
wait_for_workflow

raise 'The workflow did not complete successfully. Check the vRO UI for more info.' unless workflow_successful?
raise vro_client.log.to_s unless workflow_successful?

validate_create_output_parameters!

Expand All @@ -112,7 +112,7 @@ def execute_destroy_workflow(state)
execute_workflow
wait_for_workflow

raise 'The workflow did not complete successfully. Check the vRO UI for more info.' unless workflow_successful?
raise vro_client.log.to_s unless workflow_successful?
end

def execute_workflow
Expand Down
4 changes: 4 additions & 0 deletions spec/vro_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@
'ip_address' => ip_address
}
end
let(:vro_client) { double('vro_client') }

before do
allow(driver).to receive(:set_workflow_vars)
allow(driver).to receive(:set_workflow_parameters)
allow(driver).to receive(:execute_workflow)
allow(driver).to receive(:vro_client).and_return(vro_client)
allow(driver).to receive(:wait_for_workflow)
allow(driver).to receive(:workflow_successful?).and_return(true)
allow(driver).to receive(:validate_create_output_parameters!)
Expand All @@ -184,6 +186,7 @@

it 'raises an error if the workflow did not complete successfully' do
allow(driver).to receive(:workflow_successful?).and_return(false)
allow(vro_client).to receive(:log)
expect { driver.execute_create_workflow(state) }.to raise_error(RuntimeError)
end

Expand Down Expand Up @@ -222,6 +225,7 @@

it 'raises an error if the workflow did not complete successfully' do
allow(driver).to receive(:workflow_successful?).and_return(false)
allow(vro_client).to receive(:log)
expect { driver.execute_destroy_workflow(state) }.to raise_error(RuntimeError)
end
end
Expand Down