[Bug 18712] New: Run database_dependent test suite --No ignored
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Bug ID: 18712 Summary: Run database_dependent test suite --No ignored Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Installation and upgrade (command-line installer) Assignee: gmcharlt@gmail.com Reporter: bob-ewart@bobsown.com QA Contact: testopia@bugs.koha-community.org Created attachment 63893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63893&action=edit Full log of 'make test' including STDERR and STDOUT Build Koha from the tarball. Answer no to 'run the database-dependent test suite (no, yes) no. Running 'make test' generates many errors trying to access the database. Most of the tests which do generate DBD::mysql::st errors still show up as 'ok'. See the attached log. t/Matcher.t and t/Prices.t do fail Test Summary Report ------------------- t/Matcher.t (Wstat: 768 Tests: 12 Failed: 3) Failed tests: 3-5 Non-zero exit status: 3 t/Prices.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 16 tests but ran 5. Files=100, Tests=11528, 95 wallclock secs ( 0.89 usr 0.16 sys + 81.23 cusr 3.06 csys = 85.34 CPU) Result: FAIL Failed 2/100 test programs. 4/11528 subtests failed. Makefile:9572: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 255 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Bob Ewart <bob-ewart@bobsown.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bob-ewart@bobsown.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Bob Ewart <bob-ewart@bobsown.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Priority|P5 - low |P3 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |17.05 CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #1 from Mason James <mtj@kohaaloha.com> ---
t/Matcher.t and t/Prices.t do fail
Test Summary Report ------------------- t/Matcher.t (Wstat: 768 Tests: 12 Failed: 3) Failed tests: 3-5 Non-zero exit status: 3 t/Prices.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 16 tests but ran 5. Files=100, Tests=11528, 95 wallclock secs ( 0.89 usr 0.16 sys + 81.23 cusr 3.06 csys = 85.34 CPU) Result: FAIL Failed 2/100 test programs. 4/11528 subtests failed. Makefile:9572: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 255
the Prices.t test does seem to be currently failing on jenkins.. https://jenkins.koha-community.org/job/Koha_Master_U16/lastBuild/consoleText Build #171 (31-May-2017 02:11:06) # Failed test 'No tests run for subtest "Configuration 1: 0 0"' # at t/Prices.t line 155. Can't call method "listincgst" on an undefined value at /srv/jenkins/workspace/Koha_Master_U16/C4/Acquisition.pm line 2883. # Looks like your test exited with 255 just after 5. [23:35:52] t/Prices.t ................................................ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 12/16 subtests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 int <int@arcor.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |int@arcor.de --- Comment #2 from int <int@arcor.de> --- 'make test' fails differently depending on the database (with 'run the database-dependent test suite' is set to 'no'). If he can't connect to a database (e.g. 'Access denied'), Koha_ExternalContent_OverDrive.t and XSLT.t fail. If he can connect to an empty database or a database without data (but with the tables), Matcher.t and Prices.t fail. This seems to be your case. With a "real" database with data, Matcher.t seems to work. I didn't investigate this further, but if you import kohastructure.sql, e.g.
mysql -u root -p kohatest < installer/data/mysql/kohastructure.sql and everything from installer/data/mysql/mandatory and installer/data/mysql/en, it should work. (If I didn't miss something.)
INSERT INTO aqbooksellers (id, name, listincgst, invoiceincgst) VALUES (1, '0 0', 0, 0), (2, '0 1', 0, 1), (3, '1 0', 1, 0), (4, '1 1', 1, 1); I would assume that if 'run the database-dependent test suite' is set to 'no', 'make test' ignores even working database credentials in koha-conf.xml. This doesn't seem to be the case right now. I don't know if this is a general
Prices.t seems to rely on some testdata, see the fixture data in t/Prices.t (fixtures_ok). If there is a database-connection available, he seem to want this data from the database (and not the mock anymore). So if you set it up in the database, the test also works: problem or if this bug should be split into several for each failing test (Koha_ExternalContent_OverDrive.t, XSLT.t, Matcher.t and Prices.t). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |jonathan.druart@bugs.koha-c | |ommunity.org CC| |jonathan.druart@bugs.koha-c | |ommunity.org Summary|Run database_dependent test |make test is failing with |suite --No ignored |an empty DB - t/Matcher.t Version|17.05 |master Status|NEW |ASSIGNED --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We have 2 problems here: 1/ t/Matcher.t is failing with an empty DB, the data are not mocked correctly (Prices.t has been fixed earlier, maybe with bug 18289) 2/ We access DB during compilation time, which is quite bad.
From C4::Auth, we retrieve system preference values in the BEGIN block: 62 $cas = C4::Context->preference('casAuthentication'); 64 $caslogout = C4::Context->preference('casLogout'); This should be rewritten and fixed, but it does not prevent the tests to pass, but raises the "DBI connect failed" warning.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68890 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68890&action=edit Bug 18712: Fix t/Matcher.t if DB is empty t/Matcher.t is failing with an empty DB, the data are not mocked correctly Test plan: drop your DB and recreate it without any data and prove t/Matcher.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68891 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68891&action=edit Bug 18712: Remove unecessary fixtures 2 fixtures are in a subroutine that is never called, it can be removed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68890|0 |1 is obsolete| | --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68985&action=edit Bug 18712: Fix t/Matcher.t if DB is empty t/Matcher.t is failing with an empty DB, the data are not mocked correctly Test plan: drop your DB and recreate it without any data and prove t/Matcher.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68891|0 |1 is obsolete| | --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68986&action=edit Bug 18712: Remove unecessary fixtures 2 fixtures are in a subroutine that is never called, it can be removed Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 68987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68987&action=edit Bug 18712: Added missing done_testing Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com Status|Needs Signoff |Signed Off --- Comment #9 from M. Tompsett <mtompset@hotmail.com> --- Though, I think the last two patches probable belong on their own bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68985|0 |1 is obsolete| | Attachment #68986|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 69119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69119&action=edit Bug 18712: Fix t/Matcher.t if DB is empty t/Matcher.t is failing with an empty DB, the data are not mocked correctly Test plan: drop your DB and recreate it without any data and prove t/Matcher.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 69120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69120&action=edit Bug 18712: Remove unecessary fixtures 2 fixtures are in a subroutine that is never called, it can be removed Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68987|0 |1 is obsolete| | --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 69121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69121&action=edit Bug 18712: QA Followup - Add count of tests Before patches we did 47 tests or none, we should plan the same number of tests now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to M. Tompsett from comment #8)
Created attachment 68987 [details] [review] Bug 18712: Added missing done_testing
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Added followup, we can count these tests so should have a planned number -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #14 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Nick Clemens from comment #13)
(In reply to M. Tompsett from comment #8)
Created attachment 68987 [details] [review] [review] Bug 18712: Added missing done_testing
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Added followup, we can count these tests so should have a planned number
Not that I'll challenge this, but using done_testing is better, in my opinion, in that it prevents test conflicts when multiple bugs add tests to the same test file. I've encountered this a couple times when working on bugs related to tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to M. Tompsett from comment #14)
(In reply to Nick Clemens from comment #13)
(In reply to M. Tompsett from comment #8)
Created attachment 68987 [details] [review] [review] [review] Bug 18712: Added missing done_testing
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Added followup, we can count these tests so should have a planned number
Not that I'll challenge this, but using done_testing is better, in my opinion, in that it prevents test conflicts when multiple bugs add tests to the same test file. I've encountered this a couple times when working on bugs related to tests.
Maybe koha-devel is a good place to discuss such a change. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18712 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 18224 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org