[Koha-bugs] [Bug 7167] updatedatabase improvements

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 3 16:20:41 CET 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7167

--- Comment #209 from Jared Camins-Esakov <jcamins at cpbibliography.com> ---
(In reply to comment #207)
> (In reply to comment #206)
> > If someone wanted to update the database from the command line, they could
> > do it by running misc/bin/updatedb.pl? Is that right?
> 
> Yes
> 
> > I don't see any unit tests for C4::Update::Database. This patch predates the
> > 3.12 release cycle so I'll be somewhat flexible about that, but I'd really
> > like to see a follow-up with unit tests.
> 
> I just tried to add tests for this new module but I am not happy with the
> result.
> Moreover I do not know if it will work on our build server. Indeed my test
> script only works if there is no data in the updatedb_* tables.
> 
> Jared, could you say me if you have a better idea to test it please?

Jonathan, what I would probably do is mock C4::Context->config to set
intranetdir so that C4::Update::Database will find a versions directory under
t/db_dependent/data. Then I'd make the tests relative, so that the system
checks not that there is one update applied, but that there is one more update
applied than there was when the test started.

Also, there is one more thing which I did not notice until just now: there are
several package-level variables in C4::Update::Database, which will not work
with Plack. $version and $list seem not to be used (but please confirm this),
$VERSIONS_PATH could be moved safely into the return statement for
get_versions_path, and $dbh should be retrieved in each sub that needs it. Do
you think you could fix this in your follow-up?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list