Bug 25018 - Jenkins is not running the test with $ENV{_} eq 'prove'
Summary: Jenkins is not running the test with $ENV{_} eq 'prove'
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 22001
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-30 08:14 UTC by Jonathan Druart
Modified: 2020-04-06 09:29 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25018: Use new KOHA_TESTING envvar to detect environment testing (3.08 KB, patch)
2020-03-30 08:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-03-30 08:14:52 UTC
In some tests we want to know if we are in a testing environment.
When run the usual way, our trick works, the perl interpreter matches 'prove':
  $ENV{_} eq 'prove'

In other situations, we have the KOHA_NO_TABLE_LOCKS environment variables, for the SendCirculationAlert race conditions (see bug 15854 and bug 18364).

For unknown reasons, Jenkins runs the tests with /usr/bin/perl.
Comment 1 Jonathan Druart 2020-03-30 08:21:14 UTC
Created attachment 102069 [details] [review]
Bug 25018: Use new KOHA_TESTING envvar to detect environment testing

In some tests we want to know if we are in a testing environment.
When run the usual way, our trick works, the perl interpreter matches 'prove':
  $ENV{_} eq 'prove'

In other situations, we have the KOHA_NO_TABLE_LOCKS environment variables, for the SendCirculationAlert race conditions (see bug 15854 and bug 18364).

For unknown reasons, Jenkins runs the tests with /usr/bin/perl.

This patch suggests to rename KOHA_NO_TABLE_LOCKS and use KOHA_TESTING
instead, when prove is not used (or not correctly detected as it it the
case for Jenkins)
Comment 2 Martin Renvoize 2020-03-30 08:35:22 UTC
Works great for me.. going for a straight PQA.. thanks Jonathan!
Comment 3 Martin Renvoize 2020-03-30 08:36:19 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 4 Joy Nelson 2020-04-03 23:01:25 UTC
does not apply to 19.11.x branch
please rebase if needed.
Comment 5 Jonathan Druart 2020-04-06 09:29:32 UTC
I forgot the dependency. This patch is a follow-up of bug 22001.