diff options
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/run-tests.php b/run-tests.php index 08df7ca709..60288e2d79 100755 --- a/run-tests.php +++ b/run-tests.php @@ -241,6 +241,8 @@ $ini_overwrites = array( 'precision=14', 'memory_limit=128M', 'log_errors_max_len=0', + 'opcache.fast_shutdown=0', + 'opcache.file_update_protection=0', ); function write_information($show_html) @@ -312,6 +314,7 @@ VALGRIND : " . ($leak_check ? $valgrind_header : 'Not used') . " define('PHP_QA_EMAIL', 'qa-reports@lists.php.net'); define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php'); define('QA_REPORTS_PAGE', 'http://qa.php.net/reports'); +define('TRAVIS_CI' , (bool) getenv('TRAVIS')); function save_or_mail_results() { @@ -319,7 +322,7 @@ function save_or_mail_results() $PHP_FAILED_TESTS, $CUR_DIR, $php, $output_file, $compression; /* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */ - if (!getenv('NO_INTERACTION')) { + if (!getenv('NO_INTERACTION') && !TRAVIS_CI) { $fp = fopen("php://stdin", "r+"); if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) { echo "\nYou may have found a problem in PHP."; @@ -336,8 +339,8 @@ function save_or_mail_results() $just_save_results = (strtolower($user_input[0]) == 's'); } - if ($just_save_results || !getenv('NO_INTERACTION')) { - if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { + if ($just_save_results || !getenv('NO_INTERACTION') || TRAVIS_CI) { + if ($just_save_results || TRAVIS_CI || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { /* * Collect information about the host system for our report * Fetch phpinfo() output so that we can see the PHP enviroment @@ -349,7 +352,9 @@ function save_or_mail_results() } /* Ask the user to provide an email address, so that QA team can contact the user */ - if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) { + if (TRAVIS_CI) { + $user_email = 'travis at php dot net'; + } elseif (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) { echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): "; flush(); $user_email = trim(fgets($fp, 1024)); @@ -425,7 +430,7 @@ function save_or_mail_results() $failed_tests_data .= $sep . "PHPINFO" . $sep; $failed_tests_data .= shell_exec($php . ' -ddisplay_errors=stderr -dhtml_errors=0 -i 2> /dev/null'); - if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) { + if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status) && !TRAVIS_CI) { file_put_contents($output_file, $failed_tests_data); if (!$just_save_results) { @@ -433,7 +438,7 @@ function save_or_mail_results() } echo "Please send " . $output_file . " to " . PHP_QA_EMAIL . " manually, thank you.\n"; - } else { + } elseif (!getenv('NO_INTERACTION') && !TRAVIS_CI) { fwrite($fp, "\nThank you for helping to make PHP better.\n"); fclose($fp); } @@ -811,14 +816,12 @@ HELP; fclose($failed_tests_file); } - if (count($test_files) || count($test_results)) { - compute_summary(); - if ($html_output) { - fwrite($html_file, "<hr/>\n" . get_summary(false, true)); - } - echo "====================================================================="; - echo get_summary(false, false); + compute_summary(); + if ($html_output) { + fwrite($html_file, "<hr/>\n" . get_summary(false, true)); } + echo "====================================================================="; + echo get_summary(false, false); if ($html_output) { fclose($html_file); @@ -830,7 +833,7 @@ HELP; junit_save_xml(); - if (getenv('REPORT_EXIT_STATUS') == 1 and preg_match('/FAILED(?: |$)/', implode(' ', $test_results))) { + if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) { exit(1); } @@ -2712,7 +2715,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag if (is_array($type)) { $output_type = $type[0] . 'ED'; - $temp = array_intersect(array('XFAIL', 'FAIL'), $type); + $temp = array_intersect(array('XFAIL', 'FAIL', 'WARN'), $type); $type = reset($temp); } else { $output_type = $type . 'ED'; @@ -2726,6 +2729,9 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag } elseif ('SKIP' == $type) { junit_suite_record($suite, 'test_skip'); $JUNIT['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n"; + } elseif ('WARN' == $type) { + junit_suite_record($suite, 'test_warn'); + $JUNIT['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n"; } elseif('FAIL' == $type) { junit_suite_record($suite, 'test_fail'); $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$escaped_message'>$escaped_details</failure>\n"; |