Summary: | Fix t/Prices.t having a Test::DBIx::Class cache issue | ||
---|---|---|---|
Product: | Koha | Reporter: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Component: | Test Suite | Assignee: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Status: | CLOSED FIXED | QA Contact: | Galen Charlton <gmcharlt> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, mtj, tomascohen, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18288 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18287 |
||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 18226 | ||
Bug Blocks: | |||
Attachments: |
Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue
Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue |
Description
Olli-Antti Kivilahti
2017-03-16 19:28:55 UTC
Created attachment 61190 [details] [review] Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue REPLICATE ISSUE: perl t/Prices.t -> fails AFTER THIS PATCH AND DEPENDENCIES: perl t/Prices.t -> OK It seems that it depends on 18226, not 18266. (like dependencies of 18282 and 18288) Changed dependency as appropriate. I confirm that this fixes the tests on jenkins. diff --git a/Koha/Database.pm b/Koha/Database.pm index df259c5..f8a2fba 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -215,6 +215,11 @@ sub restore_schema { # return something, then this function should, too. } +sub flush_schema_cache { + delete $database->{schema}; + return 1; +} + =head2 EXPORT None by default. diff --git a/t/Prices.t b/t/Prices.t index f89c7f6..68dc788 100644 --- a/t/Prices.t +++ b/t/Prices.t @@ -29,6 +29,7 @@ use Test::DBIx::Class { my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); +Koha::Database::flush_schema_cache(); fixtures_ok [ Currency => [ (In reply to Jonathan Druart from comment #3) > I confirm that this fixes the tests on jenkins. The way to reproduce this in kohadevbox (or the like) is to stop memcached before running the tests. And this patchset clearly fixes it! Created attachment 64002 [details] [review] Bug 18289 - Fix t/Prices.t having a Test::DBIx::Class cache issue REPLICATE ISSUE: perl t/Prices.t -> fails AFTER THIS PATCH AND DEPENDENCIES: perl t/Prices.t -> OK Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Trivial, skipping QA. Pushed to master for 17.11, thanks to everybody involved! Enhancement not pushed to 17.05.x |