Commit Graph

624 Commits

Author SHA1 Message Date
Nikita Popov
562591f5eb Remove lightning
Windows is not quite ready for the future.
2019-07-18 11:16:24 +02:00
Christoph M. Becker
e2ed7e6716 Allow multiple cache instances per user/host on Windows
Formerly, there was at most a single OPcache instance per user and the
so called system ID (which is determined from the PHP version).
Sometimes multiple OPcaches might be desired, though, particularly for
unrelated CLI scripts, which may even be necessary (e.g. for our test
suite in parallel mode).

We therefore introduce a new INI directive `opcache.cache_id` which
allows to configure independent OPcache instances for the same user.

We also use `GetUserNameW()` instead of `php_win32_get_username()`,
because the latter retrieves the user name encoded in the
`default_charset`, which can obviously yield different results for
different charsets, leading to OPcache "incompatibilities".  Slightly
worse, some characters may not even be encodeable in the
`default_charset` and would be replaced by question marks, which could
result in different users sharing the same OPcache.

We also refactor, and re-use existing APIs to avoid duplicated code.
2019-07-17 19:51:07 +02:00
Peter Kokot
f5e4771824 Remove checks for always enabled spl and pcre
Closes GH-4397
2019-07-13 14:47:37 +02:00
Nikita Popov
c02dfddda3 Include test name in JUnit testcase name
Azure does not show the classname attribute in any convenient way,
and the file name is the part we usually care about.
2019-07-11 12:46:56 +02:00
Nikita Popov
54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +02:00
Nikita Popov
b195412bf3 run-tests: Don't pass --INI-- settings to --SKIPIF--
If we're testing ini settings that cause startup failures, we'll
never get to that SKIPIF block...

Also change settings2param to return a value instead of modifying
(to a different type no less!) in place.
2019-06-28 09:17:09 +02:00
Nikita Popov
74a7d00846 run-tests: Don't die unnecessarily
die/exit leak memory, don't use them if we don't need to.
2019-06-25 14:28:58 +02:00
Nikita Popov
3a36e68c49 Don't force USE_ZEND_ALLOC=0 in run-tests.php
USE_ZEND_ALLOC=0 is useful not just for valgrind ... we should not
force USE_ZEND_ALLOC=1 if the user explicitly disabled it.
2019-06-25 10:25:44 +02:00
Nikita Popov
da275e6214 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:41:01 +02:00
Nikita Popov
ee137a7033 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-13 12:38:57 +02:00
Nikita Popov
f8a68fd935 Add test for bug #78106
Also add PHP_TEST_EXTRA_ARGS environment variable, which allows
to pass on -c, -d etc flags provided by run-tests.php. Otherwise
we won't get the built-in server to run with opcache.
2019-06-13 12:35:29 +02:00
Joe Watkins
bed8ae1d0f
junit testcase classname is used as filename on azure 2019-06-05 19:27:50 +02:00
Joe Watkins
22213de179
only clear when showing in parallel runner 2019-06-01 06:13:30 +02:00
Nikita Popov
4ef7f70987 Fix NO_INTERACTION handling in parallel test runner
This printing shouldn't depend on NO_INTERACTION, the variable that
controls this is SHOW_ONLY_GROUPS.
2019-05-31 14:03:22 +02:00
Nikita Popov
dd2bf44869 Add junit support for parallel test runner 2019-05-31 12:38:06 +02:00
Nikita Popov
137747bdaf run-tests: Remove redundant 'suites' key
We don't have nestead testsuites or similar, so drop this confusing
key.
2019-05-31 12:04:23 +02:00
Joe Watkins
a3879208c5
have parallel test runner respect NO_INTERACTION 2019-05-30 07:46:31 +02:00
Nikita Popov
24e22eb31b Run sapi tests when running all tests 2019-05-29 17:07:12 +02:00
Craig Duncan
72c330f1e6 Restore the execute bit for run-tests.php
It looks like this was accidentally removed in 03f15f705a
2019-05-28 21:51:26 +01:00
Joe Watkins
979e7d0fee
fix notice in run-tests 2019-05-23 13:09:18 +02:00
Joe Watkins
e1151c9549
run-tests improvements:
Add XLEAK section, this is made necessary by the support
  for valgrind tools other than memcheck.
  XLEAK is to a leaking test what XFAIL is to a failing test.
  Tidy up summary a little to exclude Expected Fail and Expected Leak
  when there are no expected fail/leaks
2019-05-23 10:55:25 +02:00
Joe Watkins
536532c572
add support for valgrind tools to run-tests.php 2019-05-22 20:20:13 +02:00
Christoph M. Becker
ec10e191c4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add {TMP} placeholder for PHPT INI sections
2019-05-08 19:26:02 +02:00
Christoph M. Becker
236522529c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add {TMP} placeholder for PHPT INI sections
2019-05-08 19:22:21 +02:00
Christoph M. Becker
3d0a0f801b Add {TMP} placeholder for PHPT INI sections
Several tests use `/tmp` in the `--INI--` section, but this is not
portable.  We therefore introduce the `{TMP}` placeholder which
evaluates to the system's temporary directory using
`sys_get_temp_dir()`.

We also remove the doubtful `strpos()` optimization.
2019-05-08 19:21:38 +02:00
Peter Kokot
434388a610 Add minimum required PHP version to run-tests.php
This integrates a simple minimum PHP version info in the tool and to
also define the minimum version that the tool syntax should support.
2019-03-26 22:31:01 +01:00
Nikita Popov
071ffa2e79 Don't use parallel testing with -j1 2019-03-25 14:15:26 +01:00
Nikita Popov
3c61972451 Drop lightning for concurrent worker count
This looked rather awkward even on terminals that have full unicode
support.
2019-03-25 14:13:10 +01:00
Tyson Andre
936356bf1e Make run-tests.php compatible with php 7.0-7.2
Motivation:
As an extension author, I want to speed up running tests in php <=7.3,
both locally and in CI (e.g. with valgrind).
This can be done by manually copying php 7.4's run-tests.php script
to replace the one generated by `phpize`

- list() doesn't work in php 7.0
- negative string offset doesn't work in php 7.2

If run-tests.php can be copied from php-src without any manual patches,
that would be the easiest.

Related to #2822 - I didn't see any discussion for/against compatibility
with older php versions
2019-03-25 13:58:22 +01:00
Nikita Popov
152e5393e5 Add special "all" conflict
If a test conflicts with "all", then no other tests may be run in
parallel. This is needed for windows_mb_path tests, which rely on
the console codepage, which is shared across all parallel workers.

Also add support for comments in the CONFLICTS section/file.
2019-02-21 11:04:43 +01:00
Nikita Popov
967fa51db0 Don't use uniqid for temporary POST data files
uniqid() is not necessarily unique when multiple testing processes
run in parallel.
2019-02-20 16:01:15 +01:00
Nikita Popov
e5304bb647 Add a --shuffle mode to run-tests
Makes it easier to find paralellization issues. Of course only works
if the tests aren't order-dependent...
2019-02-20 15:59:13 +01:00
Nikita Popov
57fef27521 Use PHP_BINARY by default in run-tests.php
You pretty much always want to run with -P, make it the default.
2019-02-20 12:38:40 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Dmitry Stogov
555fb294ec Don't preload tests without --FILE-- section 2019-02-20 00:06:57 +03:00
Dmitry Stogov
b2073253bf Better new-line handling 2019-02-19 19:22:42 +03:00
Nikita Popov
fa915614fe Make parallel run-tests compatible with IO capture tests
Inherit the main stdin/stdout/stderr streams into the worker processes.
We don't talk to workers via these pipes, so there shouldn't be a
problem doing this.
2019-02-19 15:53:15 +01:00
Dmitry Stogov
5cde3afda7 Better line handling 2019-02-19 17:16:48 +03:00
Dmitry Stogov
bf51b081f5 Filter preloading warning messages 2019-02-19 17:09:07 +03:00
Andrea Faulds
5ee81e0b9d run-tests.php: fix typo 2019-02-18 20:32:16 +01:00
Andrea Faulds
39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Nikita Popov
b7b3a600cb Don't suppress errors during in preload testing 2019-02-18 11:03:38 +01:00
Andrea Faulds
6662fb5c8f run-tests.php: fix all tab-space indentation inconsistency 2019-02-16 01:54:16 +01:00
Andrea Faulds
41fbeb6c56 run-tests.php: move all top-level code into a function
Prerequisite for parallelised testing:
https://github.com/php/php-src/pull/2822

Quoth Nikita @
https://github.com/php/php-src/pull/3789#issuecomment-462724550:

> @hikari-no-yume Please feel free to directly commit the first commit
> (to PHP-7.4). That's probably a big and unnecessary source of
> conflicts, and makes reviewing harder as well.
2019-02-16 01:05:04 +01:00
Nikita Popov
a2e9534798 Add a --preload testing mode to run-tests.php
Not intended for general use, it has many false positives.
2019-02-15 11:23:23 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Stanislav Malyshev
05776094f7 Merge remote-tracking branch 'github/pr/3345'
* github/pr/3345:
  Update Coding style
2018-12-02 16:00:44 -08:00
Christoph M. Becker
1acac320c5 Clean up server-tests.php remains
sapi/tests/ has been introduced as a generic means to test different
SAPIs[1].  run-tests2.php has later be renamed to server-tests.php and
recently been dropped[2].  However, the sapi/tests/test00?.php test
cases remained, even though they make no sense for run-tests.php,
since they use an unsupported format for the `--ENV--` section and the
completely unsupported `--HEADERS--` section, respectively.  While
these tests ran successfully under run-tests.php, that was only by
accident, and they did not really test something useful.  Therefore, we
remove these tests altogether.

sapi/tests/bug69487.phpt is actually a CGI test (CGI is enforced due to
the `--POST--` section), so we move it to sapi/cgi/tests, which leaves
sapi/tests/ empty.  Thus, we also remove the sapi/ directory from
run-tests.php.

Finally, we remove the `--HEADERS--` and `--REQUEST--` sections from
the list of allowed run-tests.php sections.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b671380b6b5b6e1f4f235e810afa4199e989d2ba>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=4f36acb9e65935aa657f1f22e2320a401bdbdad3>
2018-11-23 16:24:51 +01:00
Nikita Popov
62dc39edda Document --show-mem as a valid run-tests.php option
[ci skip]
2018-11-23 16:15:40 +01:00