Add a_fail_on_error parameter to ut.run to support raising exceptions on test failures#1308
Add a_fail_on_error parameter to ut.run to support raising exceptions on test failures#1308MonikaMitura wants to merge 4 commits intoutPLSQL:developfrom
Conversation
|
Hi @MonikaMitura , can you branch out of utplsql repo? |
|
1. Actually, I created my branch directly from the utPLSQL/utPLSQL develop
branch. Is there something specific in the history that looks off? Do you
want me to recreate the branch from scratch to ensure a clean commit
history?
2. Ok, I'll take care of that.
3. Could you please give me a hint on what kind of tests you're expecting
for this feature? Also, where is the best place to put them in the current
project structure?
|
|
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. Cheers |
|
Ok, I'll do it that way, probably on Monday.
I understand you want me to update the package and add new tests in
test_ut_run.pkb. I can do that. Thanks for the hint!
|
Hi Lukasz, Fork + PR from forked repo is the supported approach for external contributions. @lwasylow - thanks for quick feedback. |
|
Oh reall? Apologies :) |
|
| raise_if_packages_invalidated(); | ||
|
|
||
| exception when others then | ||
| if l_reporter is of (ut_output_reporter_base) then |
There was a problem hiding this comment.
Is there any specific reason to add this exception handler?
It seems to be out of scope of the change.
source/api/ut.pkb
Outdated
| a_exclude_schema_expr varchar2 := null, | ||
| a_exclude_object_expr varchar2 := null | ||
| a_exclude_object_expr varchar2 := null, | ||
| a_fail_on_errors boolean := false |
There was a problem hiding this comment.
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.
jgebal
left a comment
There was a problem hiding this comment.
Two small comments in code.
Note:
If you want to set up local DB for proper utPLSQL developmewnt - read the CONTRIBUTING,.md





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.