Skip to content

Add a_fail_on_error parameter to ut.run to support raising exceptions on test failures#1308

Open
MonikaMitura wants to merge 4 commits intoutPLSQL:developfrom
MonikaMitura:fail_on_err_par
Open

Add a_fail_on_error parameter to ut.run to support raising exceptions on test failures#1308
MonikaMitura wants to merge 4 commits intoutPLSQL:developfrom
MonikaMitura:fail_on_err_par

Conversation

@MonikaMitura
Copy link

Description:
This PR adds the a_fail_on_error parameter to the run procedures in ut package.

Behavior:
If a_fail_on_error is set to true, the suite will raise an exception after the execution completes if one or more tests have failed or errored. This provides consistency with the existing functionality in ut_runner.run(a_fail_on_error => true).

Changes:
Added a_fail_on_error parameter to ut.run procedures.
Logic ensures that an exception is raised post-run if the test suite status is not successful.

@lwasylow
Copy link
Member

lwasylow commented Mar 7, 2026

Hi @MonikaMitura , can you branch out of utplsql repo?
Can you remove the .bak files ?
Can you create an appropriate tests for that ?
Cheers

@MonikaMitura
Copy link
Author

MonikaMitura commented Mar 7, 2026 via email

@lwasylow
Copy link
Member

lwasylow commented Mar 7, 2026

So it looks like you forked from utplsql repo rather than branch from our develop branch, I think the automatic tests don't run on forks.
As for tests please check this file : https://github.com/utPLSQL/utPLSQL/blob/develop/test/ut3_user/api/test_ut_run.pkb

Cheers

@MonikaMitura
Copy link
Author

MonikaMitura commented Mar 7, 2026 via email

@jgebal
Copy link
Member

jgebal commented Mar 8, 2026

So it looks like you forked from utplsql repo rather than branch from our develop branch, I think the automatic tests don't run on forks. As for tests please check this file : https://github.com/utPLSQL/utPLSQL/blob/develop/test/ut3_user/api/test_ut_run.pkb

Cheers

Hi Lukasz,
Only users that are designated as utPSLQL developers can create branches directly in our repo. The repo is protected from direct public development. This is by design.

Fork + PR from forked repo is the supported approach for external contributions.
As for tests and other stuff, I will look into this now.

@lwasylow - thanks for quick feedback.

@lwasylow
Copy link
Member

lwasylow commented Mar 8, 2026

Oh reall? Apologies :)
I got so used to work on that repo that don't think used fork here before :)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

raise_if_packages_invalidated();

exception when others then
if l_reporter is of (ut_output_reporter_base) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason to add this exception handler?
It seems to be out of scope of the change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test results won't show up in the output without this exception.
without exception:
Zrzut ekranu 2026-03-09 101007

with exception:
Zrzut ekranu 2026-03-09 101230

a_exclude_schema_expr varchar2 := null,
a_exclude_object_expr varchar2 := null
a_exclude_object_expr varchar2 := null,
a_fail_on_errors boolean := false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit tests are required to confirm that the functionality is working.
Please add at least 1 tests to the test_ut_run package.
To confirm that when a failing UT is executed - an exception is thrown.

You could also add a negative test, to confirm that with null/false parameter value - no exception is thrown.

Copy link
Member

@jgebal jgebal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small comments in code.

Note:
If you want to set up local DB for proper utPLSQL developmewnt - read the CONTRIBUTING,.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants