Skip to content

Coverage not being reported when DBMS_SCHEDULER.RUN_JOB is in tests #1271

Description

@jasonlyle88

Describe the bug
When running code coverage, I get 0% code coverage is DBMS_SCHEDULER.RUN_JOB is called in the tests

below is my test:

begin
    dbms_scheduler.run_job(
        job_name            =>  c_full_job_name,
        use_current_session =>  true
    );

    select status
    into l_actual
    from all_scheduler_job_run_details
    where owner = c_owner
        and job_name = c_job_name
    order by log_date desc
    fetch first 1 rows only;

    ut.expect(l_actual).to_equal(c_succeeded);
end check_purge_job_runs;

commenting out the DBMS_SCHEDULER.RUN_JOB call returns all the code coverages to expected values.

Provide version info
Information about utPLSQL and Database version,

SQL> set serveroutput on
SQL> declare
  2    l_version varchar2(255);
  3    l_compatibility varchar2(255);
  4  begin
  5    dbms_utility.db_version( l_version, l_compatibility );
  6    dbms_output.put_line( l_version );
  7    dbms_output.put_line( l_compatibility );
  8  end;
  9* /
19.0.0.0.0
19.0.0


PL/SQL procedure successfully completed.

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

UT_VERSION
_______________
v3.1.12.3589

SQL> select * from v$version;

BANNER                                                                    BANNER_FULL                                                                                   BANNER_LEGACY                                                                CON_ID
_________________________________________________________________________ _____________________________________________________________________________________________ _________________________________________________________________________ _________
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.21.0.1.0    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production            0

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
______________________
x86_64/Linux 2.4.xx

Information about client software
This was run in SQLDeveloper and SQLcl (latest versions)

To Reproduce
Create a test that runs any job with DBMS_SCHEDULER.RUN_JOB

Expected behavior
Code coverage to be reported correctly

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions