From 0619c3d2a20e811ef5f6c55583fe4b8baafbaff2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 12 Apr 2022 17:21:03 -0700 Subject: [PATCH] Backdrop - Stop running CliRunnerTest on php80+drush There seems to be a problem in using `drush ev` with our current versions of Drush / Backdrop / PHP 8.0 ``` [bknix-edge:~/bknix/build/bcmaster/web/modules/civicrm] drush ev 'echo 123;' PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT name FROM {system} WHERE type='module' AND status=1; Array ( [:type] => module [:status] => 1 ) in drush_db_select() (line 131 of phar:///Users/totten/bknix/extern/drush8.phar/includes/dbtng.inc). Drush command terminated abnormally due to an unrecoverable error. ``` The problem is not specific to the functionality `civicrm-core.git` -- it affects anything going through `drush-backdrop` and seems to be blocked on upstream fixes. But it's been generating a bunch of red-dot noise for the past few months, and there's no point in that. Note that `CliRunnerTest` still provides coverage for several adjacent combinations, so I'm not too concerned about substantive change affecting civicrm-core. Those adjacent combinations are: * PHP80 + D7 + Drush (differ only by CMS) * PHP80 + Backdrop + Cv (differ only by CLI-runner) * PHP7x + Bacdkrop + Drush (differ only by PHP-version) --- tests/phpunit/E2E/Extern/CliRunnerTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/E2E/Extern/CliRunnerTest.php b/tests/phpunit/E2E/Extern/CliRunnerTest.php index 645a3f017c..89242d5a33 100644 --- a/tests/phpunit/E2E/Extern/CliRunnerTest.php +++ b/tests/phpunit/E2E/Extern/CliRunnerTest.php @@ -96,7 +96,11 @@ class E2E_Extern_CliRunnerTest extends CiviEndToEndTestCase { if (CIVICRM_UF === 'WordPress') { $cliRunners['wp'] = ['wp', 'wp eval \'civicrm_initialize();\'@PHP']; } - if (CIVICRM_UF === 'Drupal' || CIVICRM_UF === 'Backdrop') { + if (CIVICRM_UF === 'Drupal') { + $cliRunners['drush'] = ['drush', 'drush ev \'civicrm_initialize();\'@PHP']; + } + if (CIVICRM_UF === 'Backdrop' && version_compare(PHP_VERSION, '8', '<')) { + // At time of writing, "drush ev" doesn't work on our php80+backdrop environments $cliRunners['drush'] = ['drush', 'drush ev \'civicrm_initialize();\'@PHP']; } // TODO: Drupal8 w/drush (doesn't use civicrm_initialize?) -- 2.25.1