Bug 13230 - Bug 12995 causes test case failures
Summary: Bug 12995 causes test case failures
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 12995
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-11 02:44 UTC by Robin Sheat
Modified: 2015-06-04 23:33 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 13230: t/Biblio.t should run without a DB (1.48 KB, patch)
2014-11-11 03:07 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 13230: t/Biblio.t should run without a DB (1.58 KB, patch)
2014-11-11 04:07 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 13230: t/Biblio.t should run without a DB (1.63 KB, patch)
2014-11-11 05:54 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 13230: t/Biblio.t should run without a DB (1.75 KB, patch)
2014-11-11 06:55 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Sheat 2014-11-11 02:44:40 UTC
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /tmp/buildd/koha-3.17~git+20141111151957.e234e2b0/blib/PERL_MODULE_DIR/C4/Context.pm line 785.
# Looks like you planned 44 tests but ran 42.
# Looks like your test exited with 255 just after 42.
t/Biblio.t .......................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/44 subtests
Comment 1 Tomás Cohen Arazi 2014-11-11 03:07:19 UTC Comment hidden (obsolete)
Comment 2 Robin Sheat 2014-11-11 04:07:58 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2014-11-11 05:54:14 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-11-11 06:55:44 UTC
Created attachment 33450 [details] [review]
[PASSED QA] Bug 13230: t/Biblio.t should run without a DB

This patch makes t/Biblio.t mock the DB connexion setting
a void one. All tests in this file currently call the C4::Biblio
functions with invalid (absent) parameters, so they are expected to
raise warnings and return undef values.

If someone writes mocked tests for the rest of the functionality,
it is expected to mock the DB calls to match the desired scenario.

To test:
- Turn of MySQL
- Run
  $ prove t/Biblio.t
=> FAIL: Tests fail because of missing MySQL server
- Apply the patch
- Run
  $ prove t/Biblio.t
=> SUCCESS: Tests now pass
- Start MySQL
- Run
  $ prove t/Biblio.t
=> SUCCESS: Tests still pass
- Sign off

Regards
Tomas

Sponsored-by: The will to procrastinate
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Sponsored-by: Wanting the darn packages to build
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Sponsored-by: Not wanting to read in my maths book
Comment 5 Tomás Cohen Arazi 2014-11-11 12:57:44 UTC
Patch pushed to master.