Backdrop - Stop running CliRunnerTest on php80+drush
authorTim Otten <totten@civicrm.org>
Wed, 13 Apr 2022 00:21:03 +0000 (17:21 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 13 Apr 2022 00:48:33 +0000 (17:48 -0700)
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=&#039;module&#039; 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

index 645a3f017cbfc954df668a5b47cc9814e8d1a10c..89242d5a334b78c66c259cf1379faea958478102 100644 (file)
@@ -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?)