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 — Extra information for failed tests in results output · Issue #1000 · utPLSQL/utPLSQL

Extra information for failed tests in results output #1000

New issue
Copy link
New issue
Copy link
Closed
#1002
Closed
Extra information for failed tests in results output#1000
#1002
Copy link
Labels
bug
Milestone
v3.1.9

Description

@abasharin
abasharin
opened on Sep 27, 2019
Issue body actions

Describe the bug
In addition to test results call stack is displayed for failed tests:

SQL> exec ut.run('test_betwnstr')
Between string function
Returns substring from start position to end position [.34 sec] (FAILED - 1)
Failures:
1) basic_usage
Actual: '234' (varchar2) was expected to equal: '2345' (varchar2)
00007FF8267345Eat "TEST_BETWNSTR.BASIC_USAGE", line 0
00007FF81C9685Aat "anonymous block", line 0
00007FF8267FBFCat "SYS.DBMS_SQL.EXECUTE", line 8
00007FF852BCFCat "UT3.UT_EXECUTABLE.DO_EXECUTE", line 68
00007FF852BCFCat "UT3.UT_EXECUTABLE.DO_EXECUTE", line 68
00007FF8512F9Aat "UT3.UT_EXECUTABLE_TEST.DO_EXECUTE", line 90
00007FF8512F9Aat "UT3.UT_EXECUTABLE_TEST.DO_EXECUTE", line 90
00007FF8231Aat "UT3.UT_TEST.DO_EXECUTE", line 2088
00007FF81FF207Bat "UT3.UT_SUITE_ITEM.DO_EXECUTE", line 0
00007FF852Cat "UT3.UT_SUITE.DO_EXECUTE", line 83270
00007FF82165F3Bat "UT3.UT_RUN.DO_EXECUTE", line 0
00007FF81FF207Bat "UT3.UT_SUITE_ITEM.DO_EXECUTE", line 0
00007FF8266285Cat "UT3.UT_RUNNER.RUN", line 0
00007FFat "UT3.UT.RUN_AUTONOMOUS", line 854710538
00007FFat "UT3.UT.RUN", line 854710538
00007FFat "UT3.UT.RUN", line 854710538
00007FF852F8Bat "anonymous block", line 710
Finished in .349 seconds
1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)

Provide version info
Information about utPLSQL and Database version,

l_version: 18.0.0.0.0
l_compatibility: 12.2.0

SQL> select substr(ut.version(),1,60) as ut_version from dual;

UT_VERSION
---------------------------------------------------------------------------------
v3.1.8.3190

SQL> select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

SQL> select * from nls_session_parameters;

PARAMETER                      VALUE
------------------------------ ------------------------------
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT                DD-MON-RR
NLS_DATE_LANGUAGE              AMERICAN
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY              $
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE

17 rows selected.

SQL> select substr(dbms_utility.port_string,1,60) as port_string from dual;

PORT_STRING
---------------------------------------------------------------------------------
IBMPC/WIN_NT64-9.1.0

Information about client software
SQL*Plus

Expected behavior
Expect the output to look like in 3.1.7:

SQL> select substr(ut.version(),1,60) as ut_version from dual;

UT_VERSION
--------------------------------------------------------------------------------
v3.1.7.3096

SQL> exec ut.run('test_betwnstr')
Between string function
Returns substring from start position to end position [.014 sec] (FAILED - 1)
Failures:
1) basic_usage
Actual: '234' (varchar2) was expected to equal: '2345' (varchar2)
at "TEST_BETWNSTR.BASIC_USAGE", line 5 ut.expect( betwnstr( '1234567', 2, 5 ) ).to_equal('2345');
Finished in .016 seconds
1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)

Activity

  1. jgebal
    added this to the 3.1.9 milestone on Sep 27, 2019
  2. jgebal
    added
    bug
    on Sep 27, 2019
  3. jgebal commented on Sep 27, 2019

    @jgebal
    jgebal
    on Sep 27, 2019
    Member
    More actions

    Congratulations @abasharin
    Your issue No. is 1000
    🥇
    Thanks for reporting it.

  4. jgebal commented on Sep 27, 2019

    @jgebal
    jgebal
    on Sep 27, 2019
    Member
    More actions

    @abasharin
    Can you help me with the fix by adding this line to your test procedure TEST_BETWNSTR.BASIC_USAGE

    dbms_output.put_line( dbms_utility.format_call_stack() );
    

    Running, exec ut.run('test_betwnstr')

    And providing the full output?

  5. abasharin commented on Sep 27, 2019

    @abasharin
    abasharin
    on Sep 27, 2019
    ContributorAuthor
    More actions

    Your issue No. is 1000

    Yeah, I've noticed that as well. Lucky me! :)

    Here is the full output.
    (the test procedure, by the way, is from Getting Started documentation)

    SQL> create or replace function betwnstr( a_string varchar2, a_start_pos integer, a_end_pos integer ) return varchar2
      2  is
      3  begin
      4    return substr( a_string, a_start_pos, a_end_pos - a_start_pos );
      5  end;
      6  /
    
    Function created.
    
    SQL> create or replace package test_betwnstr as
      2
      3    --%suite(Between string function)
      4
      5    --%test(Returns substring from start position to end position)
      6    procedure basic_usage;
      7
      8  end;
      9  /
    
    Package created.
    
    SQL> create or replace package body test_betwnstr as
      2
      3    procedure basic_usage is
      4    begin
      5      ut.expect( betwnstr( '1234567', 2, 5 ) ).to_equal('2345');
      6
      7      dbms_output.put_line( dbms_utility.format_call_stack() );
      8    end;
      9
     10  end;
     11  /
    
    Package body created.
    
    SQL> set serveroutput on
    SQL> exec ut.run('test_betwnstr')
    Between string function
    Returns substring from start position to end position [.39 sec] (FAILED - 1)
    ----- PL/SQL Call Stack -----
    object      line  object
    handle    number  name
    00007FF8547B7D30         7  package body SCOTT.TEST_BETWNSTR.BASIC_USAGE
    00007FF8544B21B8         6  anonymous block
    00007FF8267FBFC8      1721  package body SYS.DBMS_SQL.EXECUTE
    00007FF852BCFC68       142  type body UT3.UT_EXECUTABLE.DO_EXECUTE
    00007FF852BCFC68        44  type body UT3.UT_EXECUTABLE.DO_EXECUTE
    00007FF8512F9A90        74  type body UT3.UT_EXECUTABLE_TEST.DO_EXECUTE
    00007FF8512F9A90        38  type body UT3.UT_EXECUTABLE_TEST.DO_EXECUTE
    00007FF8231A2088        79  type body UT3.UT_TEST.DO_EXECUTE
    00007FF81FF207B0        49  type body UT3.UT_SUITE_ITEM.DO_EXECUTE
    00007FF852C83270        66  type body UT3.UT_SUITE.DO_EXECUTE
    00007FF82165F3B0        67  type body UT3.UT_RUN.DO_EXECUTE
    00007FF81FF207B0        49  type body UT3.UT_SUITE_ITEM.DO_EXECUTE
    00007FF8266285C0       172  package body UT3.UT_RUNNER.RUN
    00007FF854710538       134  package body UT3.UT.RUN_AUTONOMOUS
    00007FF854710538       488  package body UT3.UT.RUN
    00007FF854710538       623  package body UT3.UT.RUN
    00007FF81CFFA388         1  anonymous block
    Failures:
    1) basic_usage
    Actual: '234' (varchar2) was expected to equal: '2345' (varchar2)
    00007FF8547B7Dat "SCOTT.TEST_BETWNSTR.BASIC_USAGE", line 30
    00007FF8544B21Bat "anonymous block", line 8
    00007FF8267FBFCat "SYS.DBMS_SQL.EXECUTE", line 8
    00007FF852BCFCat "UT3.UT_EXECUTABLE.DO_EXECUTE", line 68
    00007FF852BCFCat "UT3.UT_EXECUTABLE.DO_EXECUTE", line 68
    00007FF8512F9Aat "UT3.UT_EXECUTABLE_TEST.DO_EXECUTE", line 90
    00007FF8512F9Aat "UT3.UT_EXECUTABLE_TEST.DO_EXECUTE", line 90
    00007FF8231Aat "UT3.UT_TEST.DO_EXECUTE", line 2088
    00007FF81FF207Bat "UT3.UT_SUITE_ITEM.DO_EXECUTE", line 0
    00007FF852Cat "UT3.UT_SUITE.DO_EXECUTE", line 83270
    00007FF82165F3Bat "UT3.UT_RUN.DO_EXECUTE", line 0
    00007FF81FF207Bat "UT3.UT_SUITE_ITEM.DO_EXECUTE", line 0
    00007FF8266285Cat "UT3.UT_RUNNER.RUN", line 0
    00007FFat "UT3.UT.RUN_AUTONOMOUS", line 854710538
    00007FFat "UT3.UT.RUN", line 854710538
    00007FFat "UT3.UT.RUN", line 854710538
    00007FF81CFFAat "anonymous block", line 388
    Finished in .409 seconds
    1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)
    
    PL/SQL procedure successfully completed.
    
  6. abasharin commented on Sep 27, 2019

    @abasharin
    abasharin
    on Sep 27, 2019
    ContributorAuthor
    More actions

    @PhilippSalvisberg, was this call stack output added to implement "Hyperlinks for code references in test details tabs (failures, errors, warnings and info)" for utPLSQL for SQL Developer v1.0.0?

    By the way, line number for the failing code seems to be off:
    image

  7. jgebal
    added a commit that references this issue on Sep 27, 2019

    Fixed issue with stack parsing on Windows install of utPLSQL

    This issue will close once commit 14b6243 is merged into the 'develop' branch.
    14b6243
  8. jgebal commented on Sep 27, 2019

    @jgebal
    jgebal
    on Sep 27, 2019
    Member
    More actions

    @abasharin

    If you can and want to try the fix ourself, you need to change this line to be: return regexp_replace( a_stack, '^(0x)?[0-9a-f]+\s+', '', 1, 0, 'mi' );

    Fix is on it's way - will be added to 3.1.9

  9. abasharin commented on Sep 27, 2019

    @abasharin
    abasharin
    on Sep 27, 2019
    ContributorAuthor
    More actions

    Perfect! Thank you

  10. jgebal
    closed this as completedin #1002on Sep 28, 2019
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      • v3.1.9

      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.