Skip to content

Commit 91f94a9

Browse files
committed
Add remaining tests
1 parent 0c272b9 commit 91f94a9

File tree

3 files changed

+472
-23
lines changed

3 files changed

+472
-23
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: libmysqlclient test
2+
inputs:
3+
configurationName:
4+
default: ''
5+
required: false
6+
configurationParameters:
7+
default: ''
8+
required: false
9+
libmysql:
10+
default: ''
11+
required: false
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Build ${{ inputs.configurationName }}
16+
if: always()
17+
shell: bash
18+
run: |
19+
set -e
20+
LIBMYSQL=${{ inputs.libmysql }}
21+
MYSQL_BASE=${LIBMYSQL%%-linux-*}
22+
MYSQL_VERSION=${MYSQL_BASE#*-}
23+
MYSQL_DIR=$HOME/$MYSQL_BASE
24+
mkdir -p $MYSQL_DIR
25+
URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL
26+
wget -nv $URL
27+
tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR
28+
PDO_MYSQL=${MYSQL_DIR}
29+
MYSQLI=${MYSQL_DIR}/bin/mysql_config
30+
./buildconf --force
31+
./configure ${{ inputs.configurationParameters }} \
32+
--enable-option-checking=fatal \
33+
--disable-all \
34+
--enable-pdo \
35+
--with-pdo-mysql=${PDO_MYSQL} \
36+
--with-mysqli=${MYSQLI}
37+
make clean
38+
make -j$(/usr/bin/nproc) >/dev/null
39+
- name: Test ${{ inputs.configurationName }}
40+
if: always()
41+
shell: bash
42+
run: |
43+
export MYSQL_TEST_USER=root
44+
export MYSQL_TEST_PASSWD=root
45+
export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test"
46+
export PDO_MYSQL_TEST_HOST=127.0.0.1
47+
export PDO_MYSQL_TEST_USER=root
48+
export PDO_MYSQL_TEST_PASS=root
49+
export TEST_PHP_JUNIT=junit.xml
50+
export REPORT_EXIT_STATUS=no
51+
rm -rf junit.xml | true
52+
sapi/cli/php run-tests.php -P -q \
53+
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
54+
--offline --show-diff --show-slow 1000 --set-timeout 120 \
55+
ext/pdo_mysql
56+
# FIXME
57+
# - task: PublishTestResults@2
58+
# inputs:
59+
# testResultsFormat: 'JUnit'
60+
# testResultsFiles: junit.xml
61+
# testRunTitle: '${{ inputs.configurationName }}'
62+
# failTaskOnFailedTests: true
63+
# displayName: 'Export ${{ inputs.configurationName }} Results'
64+
# condition: or(succeeded(), failed())

.github/nightly_matrix.php

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ function get_branches() {
1313
});
1414
}
1515

16-
function get_matrix() {
16+
function get_test_matrix($branches) {
1717
$result = [];
1818

19-
foreach (get_branches() as $branch) {
19+
foreach ($branches as $branch) {
20+
$branch_key = strtoupper(str_replace('.', '', $branch));
21+
2022
foreach (ARCHES as $arch) {
2123
foreach ([true, false] as $debug) {
2224
foreach ([true, false] as $zts) {
23-
$branch_key = strtoupper(str_replace('.', '', $branch));
2425
$arch_key = strtoupper($arch);
2526
$debug_key = $debug ? 'DEBUG' : 'RELEASE';
2627
$zts_key = $zts ? 'ZTS' : 'NTS';
@@ -39,9 +40,46 @@ function get_matrix() {
3940
}
4041
}
4142
}
43+
44+
$result[] = [
45+
'name' => $branch_key . '_LINUX_X64_DEBUG_ZTS_ASAN_UBSAN',
46+
'branch' => $branch,
47+
'arch' => 'linux-x64',
48+
'configurationParameters' => '--enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer',
49+
'runTestsParameters' => '--asan',
50+
];
51+
52+
$result[] = [
53+
'name' => $branch_key . '_LINUX_X64_DEBUG_NTS_REPEAT',
54+
'branch' => $branch,
55+
'arch' => 'linux-x64',
56+
'configurationParameters' => '--enable-debug --disable-zts',
57+
'runTestsParameters' => '--repeat 2',
58+
];
59+
60+
$result[] = [
61+
'name' => $branch_key . '_LINUX_X64_VARIATION_DEBUG_ZTS',
62+
'branch' => $branch,
63+
'arch' => 'linux-x64',
64+
'configurationParameters' => '--enable-debug --enable-zts CFLAGS="-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1"',
65+
];
4266
}
4367

4468
return ['include' => $result];
4569
}
4670

47-
echo '::set-output name=matrix::' . json_encode(get_matrix(), JSON_UNESCAPED_SLASHES) . "\n";
71+
function get_branch_matrix($branches) {
72+
$result = array_map(function ($branch) {
73+
$branch_key = strtoupper(str_replace('.', '', $branch));
74+
return [
75+
'name' => $branch_key,
76+
'branch' => $branch,
77+
];
78+
}, $branches);
79+
80+
return ['branches' => $result];
81+
}
82+
83+
$branches = get_branches();
84+
echo '::set-output name=branch_matrix::' . json_encode(get_branch_matrix($branches), JSON_UNESCAPED_SLASHES) . "\n";
85+
echo '::set-output name=test_matrix::' . json_encode(get_test_matrix($branches), JSON_UNESCAPED_SLASHES) . "\n";

0 commit comments

Comments
 (0)