Skip to content

Code coverage is not working properly #99

Closed
@horimre

Description

@horimre

Hi,
When I right click on a specific package/procedure/function and try to run code coverage, it does not do anything.
Code coverage is only working when I select the whole DB.
Is this behaviour intentional?
I tried with SQLDeveloper v19.4.0 extension v1.1.0 and 1.1.1.
Thanks,
Imre

Activity

PhilippSalvisberg

PhilippSalvisberg commented on Apr 27, 2020

@PhilippSalvisberg
Member

Hi @horimre,

I've installed plscope-utils and then right-clicked on plscope.test_lineage_util and got this dialog:

image

and then pressed Run and after a moment the following result was shown in my browser:

image

So, it should work to run code coverage for single test package only. And it should work for multiple test packages as well.

I've used Oracle Database 19.7. But it should work also in 12.2.

What do you mean with

it does not do anything?

No dialog? No result? both? Does Run utPLSQL test work for the same test package?

Thanks,
Philipp

horimre

horimre commented on Apr 27, 2020

@horimre
Author

Hi,

There is no dialog, and no result.
After I click Code coverage... the context menu just disappears.
Run utPLSQL test is working for the same package.
Maybe the issue is that we have a very old utPLSQL install on the DB. It is v3.1.9.3270.
I am using Oracle Database 18c.

Thanks,
Imre

PhilippSalvisberg

PhilippSalvisberg commented on Apr 27, 2020

@PhilippSalvisberg
Member

Thanks for the details. utPLSQL v3.1.9 is good enough. That should not be the problem.
And it's working when you run it from the connection or package node, right?

horimre

horimre commented on Apr 27, 2020

@horimre
Author

Right, it is working when I run it from the connection. The dialog shows up I can run it and see the report.

PhilippSalvisberg

PhilippSalvisberg commented on Apr 27, 2020

@PhilippSalvisberg
Member

Could you please run the following query?

Please amend the lines commented with --2) and --3) and run it with all_dependencies in case it fails with dba_dependencies.

select referenced_owner || '.' || referenced_name AS dep_name
  from dba_dependencies                    -- 1) dba_ or all_
  WHERE owner = upper('PLSCOPE')           -- 2) owner
    AND name = upper('TEST_LINEAGE_UTIL')  -- 3) test package name
    AND referenced_owner NOT IN (
           'SYS', 'SYSTEM', 'XS$NULL', 'OJVMSYS', 'LBACSYS', 'OUTLN', 'SYS$UMF', 
           'DBSNMP', 'APPQOSSYS', 'DBSFWUSER', 'GGSYS', 'ANONYMOUS', 'CTXSYS', 
           'SI_INFORMTN_SCHEMA', 'DVF', 'DVSYS', 'GSMADMIN_INTERNAL', 'ORDPLUGINS', 
           'MDSYS', 'OLAPSYS', 'ORDDATA', 'XDB', 'WMSYS', 'ORDSYS', 'GSMCATUSER', 
           'MDDATA', 'REMOTE_SCHEDULER_AGENT', 'SYSBACKUP', 'GSMUSER', 'APEX_PUBLIC_USER', 
           'SYSRAC', 'AUDSYS', 'DIP', 'SYSKM', 'ORACLE_OCM', 'APEX_INSTANCE_ADMIN_USER', 
           'SYSDG', 'FLOWS_FILES', 'ORDS_METADATA', 'ORDS_PUBLIC_USER'
        )
    AND referenced_owner NOT LIKE 'APEX\_______'
    AND referenced_type IN ('PACKAGE', 'TYPE', 'PROCEDURE', 'FUNCTION', 'TRIGGER');

Please let me know your database version as well and if you are running it in a PDB.

Thank you.

horimre

horimre commented on Apr 27, 2020

@horimre
Author

DEP_NAME

UTPLSQL.UT_EXPECTATION
USER1.TEST_PKG
USER1.TEST_PKG_UT

Oracle Database 18c (18.0.0.0.0), running it in a PDB.

PhilippSalvisberg

PhilippSalvisberg commented on Apr 27, 2020

@PhilippSalvisberg
Member

Thanks. And, does the query work?

horimre

horimre commented on Apr 27, 2020

@horimre
Author

yes, that is the result of the query:

DEP_NAME

UTPLSQL.UT_EXPECTATION
USER1.TEST_PKG
USER1.TEST_PKG_UT

horimre

horimre commented on Apr 27, 2020

@horimre
Author

Nevermind, this must be some sort of setup issue on my side. The result and runtime should be the same when I run it from the connection and provide the package name in the include objects section. I'll just keep running it that way.

PhilippSalvisberg

PhilippSalvisberg commented on Apr 27, 2020

@PhilippSalvisberg
Member

Yes, that's a workaround.

However, I consider it a bug, when the code coverage dialog does not show up when called from a test package node. To fix it, we have to reproduce it.

Could you please open View -> Log and check if there is a utPLSQL related error message in the Logging Page tab?

horimre

horimre commented on Apr 28, 2020

@horimre
Author

There is no error message in the log. It is empty.
Code coverage is also working when I run it from the Packages node.
Btw, I am using jdk1.8.0_241.

20 remaining items

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @PhilippSalvisberg@horimre

    Issue actions

      Code coverage is not working properly · Issue #99 · utPLSQL/utPLSQL-SQLDeveloper