Skip to content
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

JUnitReporter does not report failed test results when the test case throws an exception #1072

Open
StJabin opened this issue May 19, 2020 · 3 comments

Comments

@StJabin
Copy link

@StJabin StJabin commented May 19, 2020

Information about utPLSQL and Database version:
DB Version: 12.2.0.1.0
UT Version: v3.1.6.2735

JUnitReporter is activated and jenkins job is used to run multiple test cases.

If a test case fails, JUnitReporter reports the exception stack in the logfile. But all failed test statements (ut.expect...) are not part of the reporter file. That makes it difficult to analyze the problem.

If you run the same test case from HORA the exception stack is reported and all failed test statements, like:

"ORA-06512: at "METI2TDS.TSTUTGLOSQLGLO", line 376
ORA-06512: at line 6
Actual: 4 (number) was expected to equal: 5 (number)
at "METI2TDS.TSTUTGLOSQLGLO.TESTGLOSQL3", line 373"

In JUnitReporter just the first two lines are visible.

@lwasylow
Copy link
Member

@lwasylow lwasylow commented May 22, 2020

Hi @StJabin
Did that issue occure in utPLSQL v3.10 ?
This is quite old version and lot of fixes has been done in between.
Also if it does.
Could you provide a test case to replicate.

@lwasylow lwasylow added the question label May 22, 2020
@StJabin
Copy link
Author

@StJabin StJabin commented May 28, 2020

Hi Iwasylow, thanks for replying!

I've repeated the test with UTPLSQL v3.1.10.3349. It shows the same behavior.

This is the test case:

PROCEDURE raiseExc
IS
v NUMBER;
BEGIN
ut.expect(1).to_equal(0);
v := 3 / 0;
END;

Output when I use default reporter (ut_documentation_reporter):
Failures:

  1. raiseexc
    ORA-01476: divisor is equal to zero
    ORA-06512: at "METI2TDS.TSTUTOPSFINISHPES", line 1129
    ORA-06512: at "METI2TDS.TSTUTOPSFINISHPES", line 1129
    ORA-06512: at line 6
    Actual: 1 (number) was expected to equal: 0 (number)
    at "METI2TDS.TSTUTOPSFINISHPES.RAISEEXC", line 1128 ut.expect(1).to_equal(0);

Output when I use ut_junit_reporter:

<error>
<![CDATA[
ORA-01476: divisor is equal to zero
ORA-06512: at "METI2TDS.TSTUTOPSFINISHPES", line 1129
ORA-06512: at "METI2TDS.TSTUTOPSFINISHPES", line 1129
ORA-06512: at line 6
]]>
</error>

Thanks, if you can have a look on it!

@jgebal
Copy link
Member

@jgebal jgebal commented Jun 15, 2020

Seems that error/failure reporting in JUnit reporter are mutually exclusive today.
That could be changed and we could report both.
Need to check if there are no restrictions on this from the format standard perspective.

@jgebal jgebal added enhancement and removed question labels Jul 20, 2020
@pesse pesse added the reporter label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.