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

Introduce a no-rollback option for utPLSQL. #784

Closed

Description

@jgebal

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.

Activity

  1. added this to the v3.1.3 milestone on Nov 17, 2018
  2. self-assigned this
    on Nov 17, 2018
  3. babblfisch commented on Nov 19, 2018

    @babblfisch

    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

  4. pesse commented on Nov 19, 2018

    @pesse
    Member

    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

  5. babblfisch commented on Nov 19, 2018

    @babblfisch

    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.

  6. jgebal commented on Nov 19, 2018

    @jgebal
    MemberAuthor

    No change on client

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions