Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updating reporters
  • Loading branch information
lwasylow committed Feb 7, 2022
commit ed156d791f979196b3a0dd4b986f2e527733059f
8 changes: 7 additions & 1 deletion source/reporters/ut_junit_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ create or replace type body ut_junit_reporter is
' status="' || ut_utils.test_result_to_char(a_test.result) || '"' end || '>'
);
if a_test.result = ut_utils.gc_disabled then
ut_utils.append_to_list( l_results, '<skipped/>' );
if a_test.disabled_reason is not null then
ut_utils.append_to_list( l_results, '<skipped>' );
ut_utils.append_to_list( l_results, ut_utils.to_cdata( a_test.disabled_reason ) );
ut_utils.append_to_list( l_results, '</skipped>' );
else
ut_utils.append_to_list( l_results, '<skipped/>' );
end if;
end if;
if a_test.result = ut_utils.gc_error then
ut_utils.append_to_list( l_results, '<error>');
Expand Down
2 changes: 1 addition & 1 deletion source/reporters/ut_teamcity_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ create or replace type body ut_teamcity_reporter is
lower(a_test.item.procedure_name);

if a_test.result = ut_utils.gc_disabled then
ut_utils.append_to_list( l_results, ut_teamcity_reporter_helper.test_disabled(l_test_full_name));
ut_utils.append_to_list( l_results, ut_teamcity_reporter_helper.test_disabled(l_test_full_name,a_test.disabled_reason));
else

ut_utils.append_to_list( l_results, a_test.get_serveroutputs());
Expand Down
5 changes: 4 additions & 1 deletion source/reporters/ut_teamcity_reporter_helper.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ create or replace package body ut_teamcity_reporter_helper is
return message('testFinished', l_props);
end;

function test_disabled(a_test_name varchar2, a_flow_id varchar2 default null) return varchar2 is
function test_disabled(a_test_name varchar2,a_msg varchar2 default null, a_flow_id varchar2 default null) return varchar2 is
l_props t_props;
begin
l_props('name') := a_test_name;
if a_msg is not null then
l_props('message') := a_msg;
end if;
l_props('flowId') := a_flow_id;
return message('testIgnored', l_props);
end;
Expand Down
2 changes: 1 addition & 1 deletion source/reporters/ut_teamcity_reporter_helper.pks
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ create or replace package ut_teamcity_reporter_helper is

function test_started(a_test_name varchar2, a_capture_standard_output boolean default null, a_flow_id varchar2 default null) return varchar2;
function test_finished(a_test_name varchar2, a_test_duration_milisec number default null, a_flow_id varchar2 default null) return varchar2;
function test_disabled(a_test_name varchar2, a_flow_id varchar2 default null) return varchar2;
function test_disabled(a_test_name varchar2,a_msg varchar2 default null, a_flow_id varchar2 default null) return varchar2;
function test_failed(a_test_name varchar2, a_msg in varchar2 default null, a_details varchar2 default null, a_flow_id varchar2 default null, a_actual varchar2 default null, a_expected varchar2 default null) return varchar2;
function test_std_err(a_test_name varchar2, a_out in varchar2, a_flow_id in varchar2 default null) return varchar2;

Expand Down
6 changes: 6 additions & 0 deletions source/reporters/ut_tfs_junit_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ create or replace type body ut_tfs_junit_reporter is
ut_utils.append_to_list( l_results, ut_utils.to_cdata( ut_utils.convert_collection( a_test.get_error_stack_traces() ) ) );
ut_utils.append_to_list( l_results, '</error>');
-- Do not count error as failure
elsif a_test.result = ut_utils.gc_disabled then
if a_test.disabled_reason is not null then
ut_utils.append_to_list( l_results, '<skipped type="skipped" message="'||a_test.disabled_reason||'"/>');
else
ut_utils.append_to_list( l_results, '<skipped/>' );
end if;
elsif a_test.result = ut_utils.gc_failure then
ut_utils.append_to_list( l_results, '<failure type="failure" message="Test '||a_test.name||' failed">');
ut_utils.append_to_list( l_results, ut_utils.to_cdata( a_test.get_failed_expectation_lines() ) );
Expand Down
2 changes: 1 addition & 1 deletion test/ut3_user/reporters.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ as
procedure erroring_test;

--%test(a disabled test)
--%disabled
--%disabled(Disabled for testing purpose)
procedure disabled_test;

--%aftereach
Expand Down
2 changes: 1 addition & 1 deletion test/ut3_user/reporters/test_documentation_reporter.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ create or replace package body test_documentation_reporter as
<!beforeeach!>
<!erroring test!>
<!aftereach!>
a disabled test [0 sec] (DISABLED)
a disabled test [0 sec] (DISABLED - Disabled for testing purpose)
<!afterall!>
%
Failures:
Expand Down
4 changes: 3 additions & 1 deletion test/ut3_user/reporters/test_junit_reporter.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ create or replace package body test_junit_reporter as
<system-err/>
</testcase>
<testcase classname="org.utplsql.tests.helpers.test_reporters" assertions="0" name="a disabled test" time="0" status="Disabled">
<skipped/>
<skipped>
<![CDATA[Disabled for testing purpose]]>
</skipped>
<system-out/>
<system-err/>
</testcase>
Expand Down