← 输入框|github.com|刷新
Skip to content

Under Oracle EE 18.5.0.0.0 tests with %beforeeach or %aftereach fails with ORA-20204. #884

Closed

Description

@tkleiber

Describe the bug
Under Oracle EE 18.5.0.0.0 tests with %beforeeach or %aftereach fails with ORA-20204.
ORA-20204: Suite test <before/after each procedure> does not exist
But both exist!

Provide version info
Information about utPLSQL and Database version,

set serveroutput on
declare
  l_version varchar2(255);
  l_compatibility varchar2(255);
begin
  dbms_utility.db_version( l_version, l_compatibility );
  dbms_output.put_line( l_version );
  dbms_output.put_line( l_compatibility );
end;
/

==>
PL/SQL block executed
18.0.0.0.0
18.0.0

-> this query is wrong for 18c upwards, the sqlplus header shows us:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0

select substr(ut.version(),1,60) as ut_version from dual;
v3.1.6.2735

select * from v$version;

==>
BANNER                                                                                 BANNER_FULL                                                                                          BANNER_LEGACY                                                                          CON_ID                                       
-------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -------------------------------------------- 
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production                 Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0            Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production                                                            0 

select * from nls_session_parameters;

==>
PARAMETER                                                                                            VALUE                                                                                                
---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- 
NLS_LANGUAGE                                                                                         GERMAN                                                                                               
NLS_TERRITORY                                                                                        GERMANY                                                                                              
NLS_CURRENCY                                                                                         €                                                                                                    
NLS_ISO_CURRENCY                                                                                     GERMANY                                                                                              
NLS_NUMERIC_CHARACTERS                                                                               ,.                                                                                                   
NLS_CALENDAR                                                                                         GREGORIAN                                                                                            
NLS_DATE_FORMAT                                                                                      DD.MM.RRRR                                                                                           
NLS_DATE_LANGUAGE                                                                                    GERMAN                                                                                               
NLS_SORT                                                                                             GERMAN                                                                                               
NLS_TIME_FORMAT                                                                                      HH24:MI:SSXFF                                                                                        
NLS_TIMESTAMP_FORMAT                                                                                 DD.MM.RR HH24:MI:SSXFF                                                                               
NLS_TIME_TZ_FORMAT                                                                                   HH24:MI:SSXFF TZR                                                                                    
NLS_TIMESTAMP_TZ_FORMAT                                                                              DD.MM.RR HH24:MI:SSXFF TZR                                                                           
NLS_DUAL_CURRENCY                                                                                    €                                                                                                    
NLS_COMP                                                                                             BINARY                                                                                               
NLS_LENGTH_SEMANTICS                                                                                 CHAR                                                                                                 
NLS_NCHAR_CONV_EXCP                                                                                  FALSE                                                                                                

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

==>
PORT_STRING                                                        
------------------------------------------------------------------ 
x86_64/Linux 2.4.xx                                                

Information about client software
What client was used to run utPLSQL tests? Was it from TOAD, SQLDeveloper, SQLPlus, PLSQL Developer etc...

To Reproduce
Steps to reproduce the behavior:

  1. In SQL Developer with utPLSQL extension create the provided test package in Oracle EE 18.5.0.0.0 and open the package
  2. Right Click open the context menu in editor and click "Run utPLSQL Test"
  3. See error in te script output:
    ORA-06512: at "UT3.UT_SUITE_MANAGER", line 680
    ORA-06512: at "UT3.UT_RUNNER", line 150

ORA-20204: Suite test s205031.test_betwnstr.setup does not exist
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 680

Error starting at line : 2 in command -
BEGIN ut.run('S205031.test_betwnstr.setup'); END;
Error report -
ORA-20204: Suite test s205031.test_betwnstr.setup does not exist
ORA-06512: at "UT3.UT_RUNNER", line 163
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 680
ORA-06512: at "UT3.UT_RUNNER", line 150
ORA-06512: at "UT3.UT", line 126
ORA-06512: at "UT3.UT", line 427
ORA-06512: at "UT3.UT", line 538
ORA-06512: at line 1

Expected behavior
The test should find and run the beforeEach and aftereach procedures. It is possible, that other annotations run into this error, so you should check all.

Example code
Will attach a modified test_betwnstr package to reproduce this issue.

Additional context
Add any other context about the problem here.

Activity

  1. tkleiber commented on Mar 29, 2019

    @tkleiber
    Author

    Here is the testcase:
    test_betwnstr.zip

  2. jgebal commented on Mar 29, 2019

    @jgebal
    Member
    1. Did this start to occur after utPLSQL upgrade of DB upgrade?

    2. Did you see similar issues with previous version of utPLSQL v3.1.3 ?

    3. Can you share the results of following.

    • annotation cache
    select * from ut_annotation_cache c where c.cache_id in (select i.cache_id from ut_annotation_cache_info i where i.object_onwer = 'S205031' and i.object_name = 'TEST_BETWNSTR';
    • suite cache
    select 
      xmltype(
        cursor(
          select * from ut_suite_cache s
           where s.object_owner = 'S205031' and s.object_name = 'TEST_BETWNSTR'
        )
      )
    from dual;
    • debug log
    ut.run('S205031.TEST_BETWNSTR',ut_debug_reporter());

    I'll investigate the changes done between those two releases.

  3. added this to the v3.1.7 milestone on Mar 29, 2019
  4. tkleiber commented on Mar 29, 2019

    @tkleiber
    Author

    Did this start to occur after utPLSQL upgrade of DB upgrade?
    We actually try to migrate from Oracle 11.2.0.4 to 18.5.0.0.0 an have imported relevant schemas.
    As v3.1.3 shows this error in 18.5.0.0.0 I have upgraded utPLSQL to v.3.1.6 before creating this issue.
    The error remains.

    Did you see similar issues with previous version of utPLSQL v3.1.3 ?
    Yes!

    Can you share the results of following.
    annotation cache

    ==>
    CACHE_ID ANNOTATION_POSITION ANNOTATION_NAME ANNOTATION_TEXT SUBOBJECT_NAME


            1107                         3 suite                                                                                                Between string function                                                                                                                                                                                   
            1107                         5 beforeeach                                                                                                                                                                                                setup                                                                                                
            1107                         8 aftereach                                                                                                                                                                                                 teardown                                                                                             
            1107                        11 test                                                                                                 Returns substring from start position to end position                                                normal_case                                                                                          
            1107                        14 test                                                                                                 Returns substring when start position is zero                                                        zero_start_position                                                                                  
            1107                        17 test                                                                                                 Returns string until end if end position is greater than string length                               big_end_position                                                                                     
            1107                        20 test                                                                                                 Returns null for null input string value                                                             null_string                                                                                          
            1107                        23 test                                                                                                 A demo of test raising runtime exception                                                             bad_params                                                                                           
            1107                        26 test                                                                                                 A demo of failing test                                                                               bad_test                                                                                             
            1107                        29 test                                                                                                 Demo of a disabled test                                                                              disabled_test                                                                                        
            1107                        30 disabled                                                                                                                                                                                                  disabled_test                                                                                        
    

    suite cache

    suite_cache.zip

    debug log

    debug_log.zip

    I'll investigate the changes done between those two releases.

    Have upgraded to v3.1.6 on Oracle EE 11.2.0.4, there the error does not happen. So this seems to be related to the database version.

  5. jgebal commented on Mar 29, 2019

    @jgebal
    Member

    Thanks @tkleiber for the inputs.
    Sute suite_cache.xml is empty - can you re-upload or are the results of the query actually empty?

  6. tkleiber commented on Mar 29, 2019

    @tkleiber
    Author

    Seems I found another bug in quest sql navigator, saving xml to file does not work there, now I have copied this manually:

    suite_cache.zip

  7. jgebal commented on Mar 29, 2019

    @jgebal
    Member

    Ah...
    I think it's not utPLSQL bug, but SQLDeveloper or SQLDeveloper-plugin bug.
    Just noticed it now.
    In your command line you have:

    Error starting at line : 2 in command -
    BEGIN ut.run('S205031.test_betwnstr.setup'); END;
    Error report -
    ORA-20204: Suite test s205031.test_betwnstr.setup does not exist
    ORA-06512: at "UT3.UT_RUNNER", line 163
    ORA-06512: at "UT3.UT_SUITE_MANAGER", line 680
    ORA-06512: at "UT3.UT_RUNNER", line 150
    ORA-06512: at "UT3.UT", line 126
    ORA-06512: at "UT3.UT", line 427
    ORA-06512: at "UT3.UT", line 538
    ORA-06512: at line 1

    The problem is:
    BEGIN ut.run('S205031.test_betwnstr.setup'); END;

    You are trying to call the setup procedure as a test. Path S205031.test_betwnstr.setup is not a valid test path.
    I believe the error message could be better but I do not have a good idea how to make it more intuitive. Any cuggestions welcome

    Do you see the same issue if you run the same thing but with one of the below command?
    BEGIN ut.run('S205031.test_betwnstr'); END;
    BEGIN ut.run('S205031.normal_case'); END;
    BEGIN ut.run('S205031'); END;

    I'm not sure if there is a change in behavior of the plugin (selecting different path/node) when invoked.

    If you're doing exactly the same thing (clicks in UI) on both DB versions and see different behavior - it's probably SQLDeveloper plugin that needs to be improved.

  8. tkleiber commented on Mar 29, 2019

    @tkleiber
    Author

    Ok - it seems, that the plugin generate this call from the editor if I'm between the first line (where the package name is) and between the procedure setup defintion (line 8). Then it seems to find the next procedure definition and use it.

    I think it should lonly generate a procedure test, when I'm on a procedure with a test anotation and else the package test.

    Sorry for being so blind! But I mixed this up with a problem which I have with another user in this database. But I will create another issue therefore.

  9. jgebal commented on Mar 29, 2019

    @jgebal
    Member

    Cheers Torsten
    Can yo create it under SQLDeveloper-plugin project?
    https://github.com/utPLSQL/utPLSQL-SQLDeveloper

    Otherwise I hope v3.1.6 works fine for you.
    Also, would you be interested in framework-startup time improvements?
    If so, let me know, there is a feature branch that is to be tested by one of developers that are using Oracle EBS, where they suffer from long startup time for the framework.

    Thanks
    Jacek

  10. tkleiber commented on Mar 29, 2019

    @tkleiber
    Author

    Maybe you can give me quick hint? Does a user need a specific grant or access to use utPLSQL?
    Running the standard test_betwnstr there fails with:

    Call params for test are not valid: package does not exist or is invalid: XXXXXX.TEST_BETWNSTR

    And this happens for all 1400 tests.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions