From 525ca46cc7a89f23d816de7e5aee9c3a67b8392d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 29 May 2020 14:41:25 -0300 Subject: [PATCH] Bug 25623: Make sure oauth.t rolls back the db This patch adds a missing transaction wrapping one of the subtests. This is probably an oversight when refactoring this file. To test: 1. Open the patron categories page 2. Run: $ kshell k$ prove t/db_dependent/api/v1/oauth.t => SUCCESS: Tests pass 3. Reload the patron categories page => FAIL: There's random data in there 4. Apply this patch and repeat 2 5. Reload the patron categories page => SUCCESS: The random data from the previous tests is still there, but no new random data => SUCCESS: Tests still pass 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Julian Maurice Signed-off-by: Jonathan Druart (cherry picked from commit f898cef4f4b5a9f424f968a58b96898f26f80035) Signed-off-by: Lucas Gass (cherry picked from commit 0734017ab62e05ee4b365ac4546dc68acefa86ca) Signed-off-by: Aleisha Amohia (cherry picked from commit 4c536ffbcecfeeb9e6d6473e7c7c4cddfe4c5006) Signed-off-by: Victor Grousset/tuxayo --- t/db_dependent/api/v1/oauth.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/db_dependent/api/v1/oauth.t b/t/db_dependent/api/v1/oauth.t index 16e273cedd..8e79b6eeba 100755 --- a/t/db_dependent/api/v1/oauth.t +++ b/t/db_dependent/api/v1/oauth.t @@ -130,6 +130,8 @@ subtest 'Net::OAuth2::AuthorizationServer missing tests' => sub { plan tests => 10; + $schema->storage->txn_begin; + my $load_conditional = Test::MockModule->new('Module::Load::Conditional'); # Enable the client credentials grant syspref @@ -161,4 +163,5 @@ subtest 'Net::OAuth2::AuthorizationServer missing tests' => sub { ->status_is(400) ->json_is( { error => 'Unimplemented grant type' } ); + $schema->storage->txn_rollback; }; -- 2.20.1