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 — Odd default ordering of tests when using contexts · Issue #1036 · utPLSQL/utPLSQL

Odd default ordering of tests when using contexts #1036

New issue
Copy link
New issue
Copy link
Closed
#1037
Closed
Odd default ordering of tests when using contexts#1036
#1037
Copy link
Assignees
jgebal
Labels
bug
Milestone
v3.1.10

Description

@jgebal
jgebal
opened on Dec 29, 2019
Issue body actions

Describe the bug
When a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification.

When test suite contains a context, the ordering is no longer directly related to test or context position in test suite.

Provide version info
Affects all versions that support contexts.

To Reproduce
Create two test packages. One with contexts one without.

create or replace package demo_1 as
  --%suite

  --%test(First)
  procedure t1;
  --%test(Second)
  procedure t2;
  --%test(Third)
  procedure t3;
  --%test(Forth)
  procedure t4;
end;
/
create or replace package body demo_1 as
  procedure t1 is begin null; end;
  procedure t2 is begin null; end;
  procedure t3 is begin null; end;
  procedure t4 is begin null; end;
end;
/
create or replace package demo_2 as
  --%suite

  --%test(First)
  procedure t1;

  --%context(Context 1)

    --%test(Second)
    procedure t2;

  --%endcontext
  --%context(Context 2)

    --%test(Third)
    procedure t3;

  --%endcontext

  --%test(Forth)
  procedure t4;
end;
/
create or replace package body demo_2 as
  procedure t1 is begin null; end;
  procedure t2 is begin null; end;
  procedure t3 is begin null; end;
  procedure t4 is begin null; end;
end;
/

Run tests:
call ut.run('demo_1,demo_2');

Results are:

demo_2
  Context 2
    Third [.006 sec]
  Context 1
    Second [.003 sec]
  First [.003 sec]
  Forth [.003 sec]

demo_1
  First [.001 sec]
  Second [.001 sec]
  Third [.001 sec]
  Forth [.001 sec]

Finished in .028732 seconds
8 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Expected behavior
Run tests:
call ut.run('demo_1,demo_2');

Results are:

demo_2
  First [.003 sec]
  Context 1
    Second [.003 sec]
  Context 2
    Third [.006 sec]
  Forth [.003 sec]

demo_1
  First [.001 sec]
  Second [.001 sec]
  Third [.001 sec]
  Forth [.001 sec]

Finished in .028732 seconds
8 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Additional context
The ordering of tests is mostly relevant when trying to write tests as documentation for your code, so that the tests tell a story.

Activity

  1. jgebal
    added
    bug
    on Dec 29, 2019
  2. jgebal
    added this to the 3.1.10 milestone on Dec 29, 2019
  3. jgebal
    added a commit that references this issue on Dec 29, 2019

    Changed ordering of tests for suites with context

    This issue will close once commit e6e8c49 is merged into the 'develop' branch.
    e6e8c49
  4. jgebal
    self-assigned this
    on Dec 29, 2019
  5. jgebal
    added a commit that references this issue on Jan 3, 2020

    Changed ordering of tests for suites with context

    This issue will close once commit d02ac94 is merged into the 'develop' branch.
    d02ac94
  6. jgebal
    closed this as completedin #1037on Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jgebal
    jgebal

Labels

bug

Type

No type

Projects

No projects

    Milestone

    • v3.1.10

    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.