Commit Graph

762 Commits

Author SHA1 Message Date
Ilija Tovilo
11597d18d6
Add retry mechanism in run-tests.php
We have lots of spurious failures in CI, many of them with the "all" CONFLICT.
We're limiting the retrying to specific error messages. In the future we may
also provide a FLAKY section to retry specific tests.

Closes GH-10892
2023-05-03 13:47:13 +02:00
Ilija Tovilo
471105abd7
Another attempt to fix MSAN nightly on master 2023-03-15 23:37:36 +01:00
Ilija Tovilo
63525ee600
use_tls=0 on MSAN
Attempt to fix MSAN failure in CI

Closes GH-10851
2023-03-14 17:42:23 +01:00
Arnaud Le Blanc
8c0698f66b
Fix run-tests.php hanging when a worker process dies without notice (#9931)
run-tests.php with `-jN` can hang if a parallel worker dies without notice. This
can happen due to fatal errors in the worker, or if the worker is killed.

- run-tests.php (main process)
  \_ run-tests.php (worker #0) // main process hangs if this one crashes
     \_ test-001.php (test-001.phpt)
2023-01-13 17:43:17 +01:00
Ilija Tovilo
ed1e703716
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Migrate i386 to GitHub actions
2022-11-03 14:37:17 +01:00
Ilija Tovilo
75970077b0
Migrate i386 to GitHub actions
Closes GH-9856
2022-11-03 14:34:54 +01:00
Christoph M. Becker
d430652935
Fix --CGI-- support of run-tests.php
The `--CGI--` section is supposed to be just a marker, and to be empty
as such.  However, a previous refactoring[1] broke that.

[1] <9140c9038a>

Closes GH-9061.
2022-07-20 14:41:28 +02:00
George Peter Banyard
c05c96b3fe Fix GH-8691 Add required extensions for redirected tests 2022-06-08 11:37:07 +01:00
Remi Collet
43dd512eb6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  typo
2022-03-29 10:20:34 +02:00
Remi Collet
fe4aba6588
typo 2022-03-29 10:20:21 +02:00
Remi Collet
85533e741a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n]
2022-03-29 09:55:04 +02:00
Remi Collet
23cce68d24
run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n] 2022-03-29 09:54:40 +02:00
Christoph M. Becker
87d9e02f01
Don't truncate subsecond precision in run-tests.php JUNIT output
When run-tests.php has been typed[1], the type of `$time` has been
chosen to be `int`.  This, however, leads to truncation, and the
somewhat relevant subsecond precision is lost.  We fix that by
changing the type to `float`, although `int|string` would be more
appropriate, but requires PHP ≥ 7.4.0.  Another option would be to
move the `number_format()` formatting into `junit_mark_test_as()`.

[1] <11274f53e7>

Closes GH-7836.
2021-12-27 22:15:33 +01:00
Remi Collet
39e4ae0c04
[ci skip] typo 2021-10-12 13:39:24 +02:00
Remi Collet
ea00e6501c
Fix #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php 2021-10-12 13:33:16 +02:00
Nikita Popov
9fc6be297f Add env var to disable skip cache
DISABLE_SKIP_CACHE=1 can be used to disable the skip cache. This
does not control the extensions cache.

See https://externals.io/message/116044 for related discussion.

Closes GH-7510.
2021-09-29 13:05:25 +02:00
Nikita Popov
1015eefffe Automatically skip ext/opcache tests under --preload
Also skip observer tests, as these will observe the additional
preload file inserted by the test runner.
2021-07-30 17:26:45 +02:00
Nikita Popov
1a370d3321 Skip some tests under --preload
A genuine problem here is that we sometime get different class
casing due interaction with the ZSTR CE cache. Ignore these for
now.
2021-07-30 17:26:39 +02:00
Nikita Popov
6aa08736bb Don't unlink preload file if test failed 2021-07-27 14:36:38 +02:00
Nikita Popov
bf40a933cd Add --bless option to run-tests.php
This runs bless_tests.php on all failed tests.
2021-07-16 14:39:47 +02:00
Nikita Popov
748568268a Make LDAPCONF test work on windows
Rather than using putenv(), use the ENV section. This also
required adding {PWD} support for it.
2021-06-14 10:40:18 +02:00
Nikita Popov
ea126c5204 Fix EXTENSIONS for cgi tests
The extension information needs to be fetched using the cli binary,
not the cgi binary.
2021-06-11 14:42:58 +02:00
Bob Weinand
0dbbf9ec47 Merge branch 'PHP-8.0' 2021-06-04 16:29:40 +02:00
Bob Weinand
c916613f13 Fix null handling in test runner when printing env 2021-06-04 16:29:14 +02:00
Bob Weinand
13d396bb59 Merge branch 'PHP-8.0' 2021-05-31 10:48:11 +02:00
Bob Weinand
76a4ea5e2a Export ENV in .sh file generated by run-tests 2021-05-31 10:47:14 +02:00
Nikita Popov
ea256a218b Add %0 format to run-tests.php
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
2021-05-29 11:33:13 +02:00
Christoph M. Becker
6f89da78d0
Adjust run-tests.php to dynamic extension loading
PR #6787 changed the behavior of the `--EXTENSIONS--` section, so that
not yet loaded extensions are dynamically loaded if possible.  However,
when no tests are specified for the runner, only tests for already
loaded extensions are run, what defeats the purpose of the improvement
of the `--EXTENSIONS--` behavior.  We cater to that by detecting
loadable extensions, and also run their tests.
2021-05-27 11:33:36 +02:00
Nikita Popov
b8e4d9f387 Use shell-free proc_open() in parallel run-tests.php 2021-05-19 20:46:50 +02:00
Michael Voříšek
3ccc0409ce Remove no longer used "log_errors_max_len" ini directive (#6838)
This is a re-application of the original match against master.
The patch was originally applied to master, then reverted from
there, incorrectly applied to PHP-8.0, reverted from there due
to ABI break, and now lands on master again. We can only hope
that it does not get reverted again ;)
2021-05-10 19:26:33 +02:00
Nikita Popov
090627048c Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit d2d227e547.

This is an ABI break.
2021-05-08 20:54:53 +02:00
Ben Ramsey
b5d5d06ff3
Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit cc2c810dcf.
2021-05-08 13:23:58 -05:00
Michael Voříšek
d2d227e547
Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-08 13:05:13 -05:00
Michael Voříšek
cc2c810dcf
Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-07 19:07:35 -05:00
Mark Gallagher
39876ba1c6 run-tests: Fix warning when specifying xdebug as a required extension 2021-04-25 22:07:00 +02:00
Max Semenik
bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00
Nuno Maduro
e44f610443 Removes 'Parallel Edition' output in tests
Closes GH-6806.
2021-03-29 00:49:40 +02:00
Max Semenik
6c9a05667b run-tests: use the EXTENSIONS section for skipping
Currently, most skip checks are just for making sure an extension is
available. Even with recent addition of skip caching, this makes tests
needlessly slow:
* Checks for the same extension in its tests can have small differences
  impacting cacheability.
* Even identical skip checks in two tests can still be executed twice if
  they're run by different workers.

To remedy this, I'm repurposing the existing --EXTENSIONS-- section of
.phpt files to specify wjich extensions are required for current test to
run. Current behavior:
1) If the extension is already visible to PHP, all is good
2) If it isn't, assume it's present as a shared module and attempt to add
   it via a command line parameter
3) If that works, all is good
4) If it doesn't, PHP fails with a cryptic error message trying to
   execute the test itself

After this commit:
1) and 2) are kept unchanged
3) Check if shared extension file from 2) is actually present
4) Skip the test if it isn't

Other benefits include clear skip reasons (vs. sometimes none in many
current skip checks) and moving test information from code to metadata,
opening more opportunities for search and analysis.

Since --EXTENSIONS-- is barely ever used, this change poses no risk of
hidden failures.

As a demonstration of the new approach, this commit migrates one
extension to it. If merged, I will migrate other extensions in
subsequent PRs.

Closes GH-6787.
2021-03-22 09:53:38 +01:00
Max Semenik
9140c9038a run-tests.php: class for test file loading
This moves a bunch of code outside of run_tests(), making it a bit
more manageable. Additionally, accessors provide better readability
than isset() and friends.

This is a minimal patch that moves the code but does not refactor
much. For the sake of reviewing experience, it does not involve
further refactoring which could include:
* Removing setSection()
* Fixing up the mess with hasSection() vs. sectionNotEmpty(), only
  one of which is really needed.
* Moving more repetitive code into the new class.
All of this will be done with later commits.

Closes GH-6678.
2021-03-16 11:51:55 +01:00
Nikita Popov
0074a1d4e3 Make the nocache tag actually work
If nocache is used, then we should return an empty string result,
so the test doesn't get marked as borked.

Also limit to an occurrence at the start, just like other skip
tags.
2021-03-04 16:34:10 +01:00
Nikita Popov
4d43cbe333 Add mechanism to skip the skipif cache
If the SKIPIF section return nocache, don't cache the result. This
is used by tests that perform complex test set in conjunction with
skip checks, and need to be evaluated every time.
2021-03-04 16:28:11 +01:00
Nikita Popov
b853201a6d run-tests.php: Preserve .php on leak in one more place 2021-03-04 16:09:29 +01:00
Max Semenik
bdd7c48764 run-tests: drop support for ancient Valgrind versions
Valgrind 3.3.0 was released in 2007, not even RHEL has crap older than
this. It could be argued that 3.8.0, released in 2012, could be a safe
cutoff too.

Closes GH-6728.
2021-03-01 11:21:30 +01:00
Christoph M. Becker
51914610ab Merge branch 'PHP-8.0'
* PHP-8.0:
  Capture Microsoft-defined HRESULT exit codes exit codes
2021-02-25 12:05:27 +01:00
Christoph M. Becker
fb683030bf Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Capture Microsoft-defined HRESULT exit codes exit codes
2021-02-25 12:03:43 +01:00
Dylan K. Taylor
a480bf8093 Capture Microsoft-defined HRESULT exit codes exit codes
The lack of such a check leads to false-passes of tests on Windows
which expect no output, but produce a segfault or similar issue. I
discovered this a while ago due to bad tests in an extension I maintain.

Closes GH-6722.
2021-02-25 12:01:04 +01:00
Max Semenik
dda0cea5cd run-tests: add skip cache
Currently every --SKIPIF-- section in every test file results in 1
extra execution of PHP, every --EXTENSIONS-- section - in 2 executions.
This is quite wasteful, as skip checking code is extremely repetitive
and extensions are fixed for every binary/ini/command parameters
combination.

This patch adds caching to all such checks.

On my machine, the gains are quite noticeable: 36s instead of 43s
with -j16, 292s instead of 337s without concurrency. Cache stats are
3780 hits, 1247 misses in the latter case. In the future, tests could
be adjusted to have more uniform skip checks to improve performance even
more.

Closes GH-6681.
2021-02-23 15:05:49 +01:00
Christoph M. Becker
b84e3b1ced Merge branch 'PHP-8.0'
* PHP-8.0:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:23:22 +01:00
Christoph M. Becker
8162c3d1fd Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:22:50 +01:00
Christoph M. Becker
67bb06cc9b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:15:30 +01:00