Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot execute single test procedure that is inside context. #679

Closed
@jgebal

Description

@jgebal

The ut.run allows for execution of individual test procedure
With the below example I would expect it to work.

create or replace package test_pckg as
  --%suite

  --%context(My context)
  
  --%test(Expect failure)
  procedure mytest;
  --%endcontext
end;
/

create or replace package body test_pckg as
  procedure mytest as
  begin
    ut.expect(1).to_equal(1);
  end;
end;
/

Running exec ut.run('test_pckg.mytest'); however raises:

ORA-20203: Suite not found
ORA-06512: at "UT3_LATEST_RELEASE.UT_RUNNER", line 133
ORA-06512: at "UT3_LATEST_RELEASE.UT", line 115
ORA-06512: at "UT3_LATEST_RELEASE.UT", line 306
ORA-06512: at "UT3_LATEST_RELEASE.UT", line 364
ORA-06512: at line 1

I would expect to be able to run single procedure from test package by simply passing package.procedure.

Another issue.
Accessing such procedure via suitepath is possible but undocumented, as suitepath is referencing context internal name context_1 rather than context description: My context.
Aith suitepath, accessing by context name would be except that the context name isn't visible to developer neither by looking at package spec nor when looking at test results.

exec ut.run(':test_pckg.context_1.mytest');

test_pckg
  My context
    Expect failure [.005 sec]
 
Finished in .007233 seconds
1 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions