Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pesse opened this issue Jun 25, 2019 · 3 comments
Labels

Comments

@pesse
Copy link
Member

@pesse pesse commented Jun 25, 2019

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;
@pesse pesse added the documentation label Jun 25, 2019
@nrogachev
Copy link

@nrogachev nrogachev commented Aug 14, 2019

@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 ...".

@pesse
Copy link
Member Author

@pesse pesse commented Aug 16, 2019

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.

@nrogachev
Copy link

@nrogachev nrogachev commented Sep 3, 2019

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.