Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yellow Color in simplecov meaning #1170

Open
rayenmhamdi opened this issue Dec 1, 2021 · 2 comments
Open

Yellow Color in simplecov meaning #1170

rayenmhamdi opened this issue Dec 1, 2021 · 2 comments
Assignees

Comments

@rayenmhamdi
Copy link

Hi
I get a report coverage from a test package.

I see green lines where these lines are covered and red line where not.
but in case of yellow color: the partially covered line: I didn't understand the meaning or how to read the numbers in the right.

in the screen show we see that the first yellow line hitted 190 time but what's the meaning of 1/2
image

a little explanation will be great.

@jgebal
Copy link
Member

jgebal commented Dec 1, 2021

Hello @rayenmhamdi
The partial coverage in the example you're providing seems to be reported incorrectly.
Partial coverage should indicate how many conditions are in line and how many of them are covered.

Take those lines of code for example:

create or replace procedure some_procedure as
begin
  if 1=0 and 2=some_function_that_returns_some_integer_value() then
    dbms_output.put_line('Should not get here'
  end if;
end;

When you execute that procedure, only first expression of the IF statement will be evaluated and therefore the partial coverage should report (1) (1/2)
In that case:

  • the (1) indicates that the line of code was execute one time
  • the (1/2) indicates that there are two expressions in that line and only first one was evaluated.

The expression 1=0 evaluates to FALSE and Oracle PLSQL will not evaluate (execute) the expression 2=some_function_that_returns_some_integer_value as the whole condition is FALSE in this case.

The report you've shared looks wrong and there should not be partial coverage reported in those lines.
It is probably due to inaccuracy in how DBMS_PLSQL_CODE_COVERAGE package works. That package is provided by Oracle.

To reproduce it locally I would need to know the:

  • DB version
  • utPLSQL version

I assume that if you change the formatting of code, the partial coverage could go away.

@jgebal jgebal self-assigned this Dec 2, 2021
@rayenmhamdi
Copy link
Author

Db version : oracle 19c standard edition
Utplsql version : v3.1.10

Is there some patch to get to fix this behaviour?

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

No branches or pull requests

2 participants