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 — Bad results for failing standalone expectations on compound data · Issue #998 · utPLSQL/utPLSQL

Bad results for failing standalone expectations on compound data  #998

New issue
Copy link
New issue
Copy link
Closed
#999
Closed
Bad results for failing standalone expectations on compound data #998
#999
Copy link
Labels
bug
Milestone
v3.1.9

Description

@jgebal
jgebal
opened on Sep 22, 2019
Issue body actions

Describe the bug
When running standalone expectations in a single session and having more than one failing expectation, the results returned by report are wrong.
This is probably also observable in regular run,when running more than one cursor/object comparison in single test.

Provide version info
utPLSQL v3.1.8

To Reproduce

clear screen
set serverout on
declare
  l_actual   sys_refcursor;
  l_expected sys_refcursor;
begin
  open l_actual   for select rownum rn from dual connect by level < 5;
  open l_expected for select rownum rn from dual connect by level = 1;
  ut.expect(l_actual).to_equal(l_expected);
  open l_actual   for select rownum rn from dual connect by level < 3;
  open l_expected for select * from (select rownum rn from dual connect by level < 3) order by 1 desc;
  ut.expect(l_actual).to_equal(l_expected);
end;
/
rollback;

This produces output:

FAILURE
  Actual: refcursor [ count = 4 ] was expected to equal: refcursor [ count = 1 ]
  Diff:
  Rows: [ 3 differences ]
    Row No. 2 - Extra:    <RN>2</RN>
    Row No. 3 - Extra:    <RN>3</RN>
    Row No. 4 - Extra:    <RN>4</RN>
  at "anonymous block", line 7
FAILURE
  Actual: refcursor [ count = 2 ] was expected to equal: refcursor [ count = 2 ]
  Diff:
  Rows: [ 2 differences ]
    Row No. 1 - Actual:   <RN>1</RN>
    Row No. 1 - Expected: <RN>2</RN>
    Row No. 2 - Actual:   <RN>2</RN>
    Row No. 2 - Expected: <RN>1</RN>
    Row No. 2 - Extra:    <RN>2</RN>
    Row No. 3 - Extra:    <RN>3</RN>
    Row No. 4 - Extra:    <RN>4</RN>
  at "anonymous block", line 10

However adding a commit or rollback in between expectations fixes the issue.

clear screen
set serverout on
declare
  l_actual   sys_refcursor;
  l_expected sys_refcursor;
begin
  open l_actual   for select rownum rn from dual connect by level < 5;
  open l_expected for select rownum rn from dual connect by level = 1;
  ut.expect(l_actual).to_equal(l_expected);
  rollback;
  open l_actual   for select rownum rn from dual connect by level < 3;
  open l_expected for select * from (select rownum rn from dual connect by level < 3) order by 1 desc;
  ut.expect(l_actual).to_equal(l_expected);
end;
/
rollback;
FAILURE
  Actual: refcursor [ count = 4 ] was expected to equal: refcursor [ count = 1 ]
  Diff:
  Rows: [ 3 differences ]
    Row No. 2 - Extra:    <RN>2</RN>
    Row No. 3 - Extra:    <RN>3</RN>
    Row No. 4 - Extra:    <RN>4</RN>
  at "anonymous block", line 7
FAILURE
  Actual: refcursor [ count = 2 ] was expected to equal: refcursor [ count = 2 ]
  Diff:
  Rows: [ 2 differences ]
    Row No. 1 - Actual:   <RN>1</RN>
    Row No. 1 - Expected: <RN>2</RN>
    Row No. 2 - Actual:   <RN>2</RN>
    Row No. 2 - Expected: <RN>1</RN>
  at "anonymous block", line 11

Expected behavior
Diff reports should always provide valid outputs.

To fix this, we can delete the diff table as part of diff cleanup.

Activity

  1. jgebal
    added
    bug
    on Sep 22, 2019
  2. jgebal
    added 2 commits that reference this issue on Sep 22, 2019

    Changed names on internal columns in cursor & object compare.

    This issue will close once commit 108abae is merged into the 'develop' branch.
    108abae

    Changed names on internal columns in cursor & object compare.

    This issue will close once commit 169d0fe is merged into the 'develop' branch.
    169d0fe
  3. jgebal
    added this to the 3.1.9 milestone on Sep 22, 2019
  4. jgebal
    closed this as completedin #999on Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      • v3.1.9

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.