Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support multiple expectation failures with teamcity reporter #1251

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

Merged
merged 4 commits into from
Apr 28, 2023
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
Added missing test for multiple expectation failures with exception t…
…hrown.
  • Loading branch information
jgebal committed Apr 27, 2023
commit 73e9cf32bce4f0b8dbd38f7da63ad253b0ae42b6
5 changes: 2 additions & 3 deletions 5 test/ut3_user/reporters.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ as

procedure erroring_test
is
l_variable integer;
l_integer_variable integer;
begin
dbms_output.put_line('<!erroring test!>');
l_variable := 'a string';
ut3_develop.ut.expect(l_variable).to_equal(1);
l_integer_variable := 'a string';
end;

procedure disabled_test
Expand Down
37 changes: 35 additions & 2 deletions 37 test/ut3_user/reporters/test_teamcity_reporter.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ create or replace package body test_teamcity_reporter as

--%test
procedure multi_failure;

--%test
procedure multi_failure_on_error;
end;]';
execute immediate q'[create or replace package body check_multiple_failures is
procedure multi_failure is
Expand All @@ -44,6 +47,14 @@ create or replace package body test_teamcity_reporter as
ut3_develop.ut.expect(2).to_equal(1);
ut3_develop.ut.expect('Bad').to_equal('Good');
end;
procedure multi_failure_on_error is
l_integer_variable integer;
begin
ut3_develop.ut.expect(1).to_be_null;
ut3_develop.ut.expect(2).to_equal(1);
ut3_develop.ut.expect('Bad').to_equal('Good');
l_integer_variable := 'a string';
end;
end;]';

end;
Expand Down Expand Up @@ -132,7 +143,7 @@ create or replace package body test_teamcity_reporter as
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected);
end;

procedure report_mutiple_expectations is
procedure report_multiple_expectations is
l_output_data ut3_develop.ut_varchar2_list;
l_expected varchar2(32767);
begin
Expand All @@ -146,7 +157,29 @@ create or replace package body test_teamcity_reporter as
--act
select *
bulk collect into l_output_data
from table(ut3_develop.ut.run('check_multiple_failures',ut3_develop.ut_teamcity_reporter()));
from table(ut3_develop.ut.run('check_multiple_failures.multi_failure',ut3_develop.ut_teamcity_reporter()));

--assert
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected);
end;

procedure report_multiple_expect_on_err is
l_output_data ut3_develop.ut_varchar2_list;
l_expected varchar2(32767);
begin
l_expected := q'{%##teamcity[testSuiteStarted timestamp='%' name='check_multiple_failures']
%##teamcity[testStarted timestamp='%' captureStandardOutput='true' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testStdErr timestamp='%' name='ut3_user.check_multiple_failures.multi_failure_on_error' out='Test exception:|nORA-06502: PL/SQL: %: character to number conversion error|nORA-06512: at "UT3_USER.CHECK_MULTIPLE_FAILURES", line %|nORA-06512: at %|n']
%##teamcity[testFailed timestamp='%' details='Test exception:|nORA-06502: PL/SQL: %: character to number conversion error|nORA-06512: at "UT3_USER.CHECK_MULTIPLE_FAILURES", line %|nORA-06512: at %|n' message='Error occured' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testFailed timestamp='%' details='Actual: 1 (number) was expected to be null' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testFailed timestamp='%' details='Actual: 2 (number) was expected to equal: 1 (number)' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testFailed timestamp='%' details='Actual: |'Bad|' (varchar2) was expected to equal: |'Good|' (varchar2)' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testFinished timestamp='%' duration='%' name='ut3_user.check_multiple_failures.multi_failure_on_error']
%##teamcity[testSuiteFinished timestamp='%' name='check_multiple_failures']}';
--act
select *
bulk collect into l_output_data
from table(ut3_develop.ut.run('check_multiple_failures.multi_failure_on_error',ut3_develop.ut_teamcity_reporter()));

--assert
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected);
Expand Down
5 changes: 4 additions & 1 deletion 5 test/ut3_user/reporters/test_teamcity_reporter.pks
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ create or replace package test_teamcity_reporter as
procedure trims_long_output;

--%test(Reports failures on multiple expectations)
procedure report_mutiple_expectations;
procedure report_multiple_expectations;

--%test(Reports failures on multiple expectations)
procedure report_multiple_expect_on_err;

--%afterall
procedure remove_test_package;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.