mirror of
https://github.com/php/php-src.git
synced 2026-04-10 17:43:13 +02:00
We always run test steps on azure, even if a previous step failed, because we don't want a failure in one configuration to prevent testing of other configurations. However, if building PHP fails in the first place, then we currently end up testing the system PHP binary. This is not only useless, but will also result in a test runner hang and cause the job to time out. Avoid this by using sapi/cli/php instead of the installed php as the test binary. If we fail to build, then it will not exist, and testing will fail immediately.
38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
parameters:
|
|
runTestsName: ''
|
|
runTestsParameters: ''
|
|
|
|
steps:
|
|
- script: |
|
|
export MYSQL_TEST_USER=root
|
|
export MYSQL_TEST_PASSWD=root
|
|
export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
|
|
export PDO_MYSQL_TEST_USER=root
|
|
export PDO_MYSQL_TEST_PASS=root
|
|
export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0"
|
|
export PDO_DBLIB_TEST_USER="pdo_test"
|
|
export PDO_DBLIB_TEST_PASS="password"
|
|
export TEST_PHP_JUNIT=junit.xml
|
|
export REPORT_EXIT_STATUS=no
|
|
export SKIP_IO_CAPTURE_TESTS=1
|
|
export MSAN_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer
|
|
rm -rf junit.xml | true
|
|
sapi/cli/php run-tests.php -P -q \
|
|
-j$(/usr/bin/nproc) \
|
|
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
|
|
--offline \
|
|
--show-diff \
|
|
--show-slow 1000 \
|
|
--set-timeout 120 \
|
|
${{ parameters.runTestsParameters }}
|
|
displayName: 'Test ${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
|
|
condition: or(succeeded(), failed())
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: 'JUnit'
|
|
testResultsFiles: junit.xml
|
|
testRunTitle: '${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
|
|
failTaskOnFailedTests: true
|
|
displayName: 'Export ${{ parameters.configurationName }} ${{ parameters.runTestsName }} Results'
|
|
condition: or(succeeded(), failed())
|