Bug 15150 - t/ tests should pass if Test::DBIx::Class is not available
Summary: t/ tests should pass if Test::DBIx::Class is not available
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-06 12:35 UTC by Tomás Cohen Arazi
Modified: 2019-06-27 09:24 UTC (History)
6 users (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 15150: Make t/ tests skip if Test::DBIx::Class absent (11.60 KB, patch)
2015-11-06 13:36 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15150: Make t/ tests skip if Test::DBIx::Class absent (11.73 KB, patch)
2015-11-06 15:05 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[PASSED QA] Bug 15150: Make t/ tests skip if Test::DBIx::Class absent (11.79 KB, patch)
2015-11-06 15:20 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2015-11-06 12:35:35 UTC
We need t/ to be skipped if they rely on Test::DBIx::Class and it is not available (this happens on the build environment, so we cannot build current master without fixing this).
Comment 1 Tomás Cohen Arazi 2015-11-06 13:36:26 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2015-11-06 15:05:21 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2015-11-06 15:20:36 UTC
Created attachment 44578 [details] [review]
[PASSED QA] Bug 15150: Make t/ tests skip if Test::DBIx::Class absent

Tests in t/ should always pass for building the Debian packages
for Koha. But we've started using Test::DBIx::Class for writing
mocked tests, and that lib is not (yet) packaged fro Debian 7+.

This means build is failing. Devs and jenkins use the lib from CPAN.

This patch makes the tests skip if the lib is absent.

To test:
- Install Test::DBIx::Class
  $ sudo cpanm Test::DBIx::Class
- Run the tests:
  $ prove t/
=> SUCCESS: Tests pass
- Uninstall Test::DBIx::Class
  $ sudo cpan -U Test::DBIx::Class
- Run the tests:
  $ prove t/
=> SUCCESS: Tests still pass (those needing the lib are skipped)
- Sign off :-D

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. All test pass successful

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2015-11-06 15:27:41 UTC
Patch pushed to master.

Thanks Hector and Kyle for fast testing this one!
Comment 5 Frédéric Demians 2015-11-27 09:15:08 UTC
I don't understand whether this patch can/must be backported to 3.20.x.
Comment 6 Tomás Cohen Arazi 2015-11-27 14:33:54 UTC
(In reply to Frédéric Demians from comment #5)
> I don't understand whether this patch can/must be backported to 3.20.x.

As I see it, this has been bothering the Packaging manager for a while. He did some trick on building so the process (which runs the tests in t/) doesn't break.
If it applies on 3.20, it is a good thing to do (backporting it).
But maybe ask Galen, the new packaging manager.
Comment 7 Frédéric Demians 2015-11-27 15:20:46 UTC
(In reply to Tomás Cohen Arazi from comment #6)

> If it applies on 3.20, it is a good thing to do (backporting it).
> But maybe ask Galen, the new packaging manager.

This patch touches several tests that have changed (more tests). So the backporting is tricky.