GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JUnitReporter does not report failed test results when the test case throws an exception · Issue #1072 · utPLSQL/utPLSQL

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

New issue
Copy link
New issue
Copy link
Open
Open
JUnitReporter does not report failed test results when the test case throws an exception#1072
Copy link
Labels
enhancement

Description

@StJabin
StJabin
opened on May 19, 2020
Issue body actions

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.

Activity

  1. lwasylow commented on May 22, 2020

    @lwasylow
    lwasylow
    on May 22, 2020
    Member
    More actions

    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.

  2. lwasylow
    added
    question
    on May 22, 2020
  3. StJabin commented on May 28, 2020

    @StJabin
    StJabin
    on May 28, 2020
    Author
    More actions

    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!

  4. jgebal commented on Jun 15, 2020

    @jgebal
    jgebal
    on Jun 15, 2020
    Member
    More actions

    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.

  5. jgebal
    added
    enhancement
    and removed
    question
    on Jul 20, 2020
  6. pesse
    added
    reporter
    on Nov 12, 2020
  7. lwasylow commented on Feb 8, 2022

    @lwasylow
    lwasylow
    on Feb 8, 2022
    Member
    More actions

    So looking onto the specification for TFS:

    <xs:documentation xml:lang="en">The total number of tests in the suite that failed. A failure is a test which the code has explicitly failed by using the mechanisms for that purpose. e.g., via an assertEquals</xs:documentation>
    

    I believe its same valid for Junit.

    I think its question between usability and conforming to format.
    I think the case presented with division by zero is not really a valid test procedure.

    For any other exceptions that we can anticipate we can use throws or as part of the test

    EXCEPTION WHEN OTHERS THEN
      ut.fail('Message'|| SQLERRM
    

    Something between these lines.

  8. jgebal
    removed
    reporter
    on Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.