From e539afe9ccfee94d7b2b2a61a4ab016cbfd4389a Mon Sep 17 00:00:00 2001 From: Andrius Dziovalas Date: Mon, 6 Apr 2020 19:15:22 +0300 Subject: [PATCH 1/2] Show vro failure logs in kitchen Signed-off-by: Andrius Dziovalas --- lib/kitchen/driver/vro.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kitchen/driver/vro.rb b/lib/kitchen/driver/vro.rb index 0a853cf..82ed300 100644 --- a/lib/kitchen/driver/vro.rb +++ b/lib/kitchen/driver/vro.rb @@ -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! @@ -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 From 37b415b07983c5c4352f8f7e49fea024f3743752 Mon Sep 17 00:00:00 2001 From: Andrius Dziovalas Date: Mon, 6 Apr 2020 20:13:09 +0300 Subject: [PATCH 2/2] Update specs to check for vro_client logs Signed-off-by: Andrius Dziovalas --- spec/vro_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/vro_spec.rb b/spec/vro_spec.rb index 39f4b45..4fb0ec4 100644 --- a/spec/vro_spec.rb +++ b/spec/vro_spec.rb @@ -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!) @@ -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 @@ -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