]> git.openstreetmap.org Git - nominatim.git/commitdiff
In tests for PHP 8 disable Just-in-time, it conflicts with tools that determine coverage
authormarc tobias <mtmail@gmx.net>
Mon, 4 Jul 2022 21:52:36 +0000 (23:52 +0200)
committermarc tobias <mtmail@gmx.net>
Sat, 9 Jul 2022 20:03:48 +0000 (22:03 +0200)
.github/workflows/ci-tests.yml
test/python/tools/test_exec_utils.py

index e3a01aa061b1855c4c0c3365a2a941a965f5035f..53b76a035d7688eb39dc43116ee2f138cf7a4b85 100644 (file)
@@ -70,6 +70,7 @@ jobs:
               with:
                   php-version: ${{ matrix.php }}
                   tools: phpunit, phpcs, composer
+                  ini-values: opcache.jit=disable
 
             - uses: actions/setup-python@v2
               with:
index 78650180f96ff0c2a668e4dd9cd641581f3526e1..26ea92b2c787fb72b6c4a39e64e9646723907cd9 100644 (file)
@@ -122,7 +122,13 @@ class TestRunApiScript:
 
     @staticmethod
     def test_fail_on_error_output(tmp_path):
-        (tmp_path / 'website' / 'bad.php').write_text("<?php\nfwrite(STDERR, 'WARNING'.PHP_EOL);")
+        # Starting PHP 8 the PHP CLI no longer has STDERR defined as constant
+        php = """
+        <?php
+        if(!defined('STDERR')) define('STDERR', fopen('php://stderr', 'wb'));
+        fwrite(STDERR, 'WARNING'.PHP_EOL);
+        """
+        (tmp_path / 'website' / 'bad.php').write_text(php)
 
         assert exec_utils.run_api_script('bad', tmp_path) == 1