Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cleanup tests version checks#2209

Closed
tvlooy wants to merge 3 commits into
php:masterphp/php-src:masterfrom
tvlooy:cleanup_tests_versionchecktvlooy/php-src:cleanup_tests_versioncheckCopy head branch name to clipboard
Closed

Cleanup tests version checks#2209
tvlooy wants to merge 3 commits into
php:masterphp/php-src:masterfrom
tvlooy:cleanup_tests_versionchecktvlooy/php-src:cleanup_tests_versioncheckCopy head branch name to clipboard

Conversation

@tvlooy
Copy link
Copy Markdown
Contributor

@tvlooy tvlooy commented Nov 20, 2016

This is clean-up. Remove all useless version checks from extension tests and remove some code or entire tests that are not valid any more.

@php-pulls
Copy link
Copy Markdown

Comment on behalf of krakjoe at php.net:

Labelling

@krakjoe
Copy link
Copy Markdown
Member

krakjoe commented Nov 20, 2016

Could I ask that you annotate the patch where files have been deleted with a specific reason (that I or someone else can verify is correct), please ?

@tvlooy
Copy link
Copy Markdown
Contributor Author

tvlooy commented Nov 20, 2016

About the removed files:

These are tests that are skipped if the PHP version is not 6.0, so they are never run:

ext/phar/tests/017U.phpt
ext/phar/tests/018U.phpt
ext/phar/tests/019bU.phpt
ext/phar/tests/019cU.phpt
ext/phar/tests/027U.phpt
ext/phar/tests/bug45218_SLOWTESTU.phpt
ext/phar/tests/cached_manifest_1U.phpt
ext/phar/tests/fopen_edgecases2U.phpt
ext/phar/tests/ini_set_offU.phpt
ext/phar/tests/metadata_readU.phpt
ext/phar/tests/metadata_writeU.phpt
ext/phar/tests/metadata_write_commitU.phpt
ext/phar/tests/mounteddirU.phpt
ext/phar/tests/phar_begin_setstub_commitU.phpt
ext/phar/tests/phar_gzipU.phpt
ext/phar/tests/phar_metadata_readU.phpt
ext/phar/tests/phar_metadata_writeU.phpt
ext/phar/tests/phar_oo_001U.phpt
ext/phar/tests/phar_oo_002U.phpt
ext/phar/tests/phar_oo_004U.phpt
ext/phar/tests/phar_oo_005U.phpt
ext/phar/tests/readfile_edgecasesU.phpt
ext/phar/tests/tar/allU.phpt
ext/phar/tests/tar/phar_begin_setstub_commitU.phpt
ext/phar/tests/tar/tar_004U.phpt
ext/phar/tests/tar/tar_bz2U.phpt
ext/phar/tests/tar/tar_gzipU.phpt
ext/phar/tests/zip/allU.phpt
ext/phar/tests/zip/metadata_write_commitU.phpt
ext/phar/tests/zip/phar_begin_setstub_commitU.phpt
ext/phar/tests/zip/phar_magicU.phpt

This is a check to make sure the test is skipped with PHP version 6.0. So it is always run:

ext/mysqli/tests/skipifunicode.inc

These are tests that are skipped if the PHP version is not lower or equal to 5.2 or 5.3, so they are never run:

ext/phar/tests/open_for_write_existing_b_5_2.phpt
ext/phar/tests/open_for_write_existing_c_5_2.phpt
ext/phar/tests/open_for_write_newfile_b_5_2.phpt
ext/phar/tests/open_for_write_newfile_c_5_2.phpt
ext/phar/tests/phar_oo_005.phpt
ext/phar/tests/phar_oo_005_5.2.phpt
ext/phar/tests/refcount1_5_2.phpt
ext/phar/tests/tar/open_for_write_existing_b_5_2.phpt
ext/phar/tests/tar/open_for_write_existing_c_5_2.phpt
ext/phar/tests/tar/open_for_write_newfile_b_5_2.phpt
ext/phar/tests/tar/open_for_write_newfile_c_5_2.phpt
ext/phar/tests/tar/refcount1_5_2.phpt
ext/phar/tests/zip/open_for_write_existing_b_5_2.phpt
ext/phar/tests/zip/open_for_write_existing_c_5_2.phpt
ext/phar/tests/zip/open_for_write_newfile_b_5_2.phpt
ext/phar/tests/zip/open_for_write_newfile_c_5_2.phpt
ext/phar/tests/zip/refcount1_5_2.phpt

Do you want me to put a comment in the diff for each of these files pointing to the line with the check? I'm not sure what you mean by annotating the diff.

magic_quotes_gpc=1
--SKIPIF--
<?php if (version_compare(PHP_VERSION, "5.3", "<")) die("skip requires 5.3 or greater"); ?>
--FILE--
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops :)

@krakjoe
Copy link
Copy Markdown
Member

krakjoe commented Nov 20, 2016

Looks fine, other than couple of failures on travis that I think shouldn't be there.

if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("spl")) die("skip SPL not available");
if (version_compare(PHP_VERSION, "5.3", "<") or version_compare(PHP_VERSION, "5.4", ">="))
die("skip requires 5.3");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why PHP >= 5.4 was excluded in this test.

@nikic
Copy link
Copy Markdown
Member

nikic commented Nov 20, 2016

Merged via 442fd2f. Thanks!

}

if (!(version_compare(PHP_VERSION, '6.0', '==') == 1)) {
mysqli_query($link, "set names utf8");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2217


/* we need to skip this test in unicode - we send set names utf8 during mysql_connect */
if (!(version_compare(PHP_VERSION, '6.0', '==') == 1))
mysqli_get_client_stats_assert_eq('non_result_set_queries', $new_info, $info, $test_counter);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.