Bug 25018: Use new KOHA_TESTING envvar to detect environment testing
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 30 Mar 2020 08:16:23 +0000 (10:16 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 30 Mar 2020 08:35:56 +0000 (09:35 +0100)
commit9816e240aa5d629bca98d9f0cb3e327bf2bc5a77
tree42c639e87b855d08926d02be1172d4e5582a6f76
parent624a24b8203624d94cbe0efdb37106065cf6cd92
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)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Circulation.pm
Koha/Database.pm