Skip to content

Introduce a no-rollback option for utPLSQL. #784

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

Closed
jgebal opened this issue Nov 17, 2018 · 4 comments
Closed

Introduce a no-rollback option for utPLSQL. #784

jgebal opened this issue Nov 17, 2018 · 4 comments
Assignees
Milestone

Comments

@jgebal
Copy link
Member

jgebal commented Nov 17, 2018

Background

Currently, when running tests from developer IDE (like SQLDeveloper/TOAD/SQLPlus/sqlcl etc.), utPLQL always runs tests in an autonomous transaction.
At the end of test-run, utPLSQL does an explicit rollback and closes the autonomous transaction, leaving the current session intact.

This behavior is OK, when you want to make sure that running tests does not affect your session state regardless of commits/rollback/DDL inside tests or tested code.

There are scenarios, where user might want to keep the modified state of the data after the test finishes without performing an explicit commit in their tests.

Proposed solution

  • Add parameter a_force_manual_rollback to ut.run procedures (not functions)
  • Make sure that with a_force_manual_rollback=true the following happens:
    • Run is executed in current transaction
    • The rollback is not performed
    • --%rollback(manual) is implicitly applied to the whole run, so automatic transaction control is disabled for all the tests getting executed.

The a_force_manual_rollback=true will have a side effect of leaving data changed between individual tests and therefore should be used with caution and awareness of side effects.

@jgebal jgebal added this to the v3.1.3 milestone Nov 17, 2018
@jgebal jgebal self-assigned this Nov 17, 2018
@babblfisch
Copy link

Hello Jacek!
This is very useful for debugging reasons, when you have to verify whats going running tests, without writing tons of debugging outputs.
Thank you, Kai

@pesse
Copy link
Member

pesse commented Nov 19, 2018

Just to document so I don't have crazy ideas again: I think this will not work in cli (we can't leave transactions open so at the end all data would be committed).
Question is if we should include the option in java-api so the enhancement can be included into IDE plugIns

@babblfisch
Copy link

I don't think that this is a useful parameter for CLI. The only reason for surpressing the rollbacks for me is for debugging reasons to see what state the data during the test has. So you can decide if the test or the source code has errors.
When I run the tests in integration enviroment the integrity of data is important and ensuring of rollback is important.

@jgebal
Copy link
Member Author

jgebal commented Nov 19, 2018

No change on client

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

No branches or pull requests

3 participants