← 输入框|github.com|刷新
Skip to content

Documentation: Make clear that beforeeach and aftereach are not called in a child suite #958

Closed

Description

@pesse

Describe the bug
Make clear that --%beforeeach and --%aftereach defined in a parent suite are not called in the child suite(s)

They can, however, be referenced like that:

create or replace package child_suite as
  --%suite
  --%suitepath(parent_suite)

  --%beforeeach(parent_suite.public_beforeeach_procedure)

  --%test
  procedure test;
end;

Activity

  1. nrogachev commented on Aug 14, 2019

    @nrogachev

    @pesse Hi.

    I was a little surprised to know that before each from parent suites are not called automatically in child suites. Is there any specific reason for that?
    The solution with the reference inside the child suite works in general, but it has an issue that in such case, as far as I can see, the parent procedure is being called inside child suite with rollback settings of the child suite. And it also requires including this reference in each child suite and that in my eyes defeats the whole purpose of parent-child hierarchy a little bit.

    As an example, if I have the parent suite where roll back setting is set to manual and the beforeeach procedure is written in a way to use it (I'm doing some system-wide setup and tear down actions which require manual transaction manipulations), and then child suite uses roll back auto, when the parent beforeeach is called from child it generates warnings like "Unable to perform automatic rollback after test context. An implicit or explicit commit/rollback occurred in procedures ...".

  2. pesse commented on Aug 16, 2019

    @pesse
    MemberAuthor

    I'm not sure if I'm understanding your use-case properly.
    Would it be possible to create a simple example that showcases what you want to achieve?
    It sounds to me like you are trying to achieve something that's just not possible with the framework, but maybe I'm missing something.

  3. nrogachev commented on Sep 3, 2019

    @nrogachev

    @pesse basically i wanted to use a generic setup routine which makes some transaction actions with commits/rollbacks and have defined it in the separate package with roll back setting set to manual.
    But i got around the problem by simply using autonomous transactions so i think you can disregard my comments, all good now :)

  4. added a commit that references this issue on Aug 21, 2026
    397c9f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions