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 — Replaced hard coded 0 in total test coverage by OsBlaineOra · Pull Request #1140 · utPLSQL/utPLSQL

Conversation

@OsBlaineOra

@OsBlaineOra OsBlaineOra commented Jun 1, 2021

Copy link
Copy Markdown
Contributor

with covered lines / total total lines.
Rounding to 17 decimal places since that's what I found when looking at cobertura examples online.
Used an rpad to generate the format mask to avoid having a long string of 9s.

This was mentioned in #1107 but does not have an issue of its own.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
OsBlaineOra added 2 commits June 1, 2021 14:17
@OsBlaineOra
Replaced hard coded 0 in total test coverage
7498530
with covered lines / total  total lines.
Rounding to 17 decimal places since that's what I found when looking at cobertura examples online.
Used an rpad to generate the format mask to avoid having a long string of 9s.

This was mentioned in utPLSQL#1107 but does not have an issue of its own.
@OsBlaineOra
Fixed a divide by zero error.
4e2b9f5
I introduced the error in the previous commit.

To fix I added a l_lines_valid variable, used a case statement to check for 0 else return the calculation.
I also replaced the lines_valid calculation to use the new variable to reduce code duplication.
jgebal
jgebal reviewed Oct 28, 2021
View reviewed changes
Comment thread source/reporters/ut_coverage_cobertura_reporter.tpb Outdated
c_classes_footer constant varchar2(30) := '</classes>';
c_lines_footer constant varchar2(30) := '</lines>';
l_epoch varchar2(50) := (sysdate - to_date('01-01-1970 00:00:00', 'dd-mm-yyyy hh24:mi:ss')) * 24 * 60 * 60;
l_lines_valid number := a_coverage_data.covered_lines + a_coverage_data.uncovered_lines;

@jgebal jgebal Oct 28, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integer will be better, as the lines are always integer

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread source/reporters/ut_coverage_cobertura_reporter.tpb Outdated
||'" branch-rate="0.0" lines-covered="'
||a_coverage_data.covered_lines||'" lines-valid="'
||TO_CHAR(a_coverage_data.covered_lines + a_coverage_data.uncovered_lines)
||TO_CHAR(l_lines_valid)

@jgebal jgebal Oct 28, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this TO_CHAR lowercase since you've touched this line?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread source/reporters/ut_coverage_cobertura_reporter.tpb
ut_utils.append_to_list(
l_result,
'<coverage line-rate="0" branch-rate="0.0" lines-covered="'
'<coverage line-rate="'

@jgebal jgebal Oct 28, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice small fix. Love it!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jgebal

jgebal commented Oct 28, 2021

Copy link
Copy Markdown
Member

Thank you @OsBlaineOra for the improvement.
Four of our tests require updates in order for the build to be successful.
Are you able to fix those?
You can check the results of the failing tests here:
https://app.travis-ci.com/github/utPLSQL/utPLSQL/jobs/536073612#L6829

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jgebal
jgebal reviewed Oct 28, 2021
View reviewed changes
Comment thread source/reporters/ut_coverage_cobertura_reporter.tpb Outdated
l_result,
'<coverage line-rate="0" branch-rate="0.0" lines-covered="'
'<coverage line-rate="'
||to_char(round((case l_lines_valid when 0 then 0 else a_coverage_data.covered_lines/(l_lines_valid) end), 17), rpad('FM0.',21,'9'))

@jgebal jgebal Oct 28, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should probably be:
to_char( value , 'TM9' , 'NLS_NUMERIC_CHARACTERS=''. ''' ) to make sure it is OK for values of "0".

See those failing tests for extra "." present there.
The tests need to be fixed as they all assume the line-rate to be ZERO.
https://app.travis-ci.com/github/utPLSQL/utPLSQL/jobs/536073612#L6935

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jgebal
Fixed failing tests and improved coverage reporting
581991b
@jgebal
jgebal merged commit b4c7db8 into utPLSQL:develop Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jgebal jgebal jgebal left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@OsBlaineOra @jgebal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.