Skip to content

Run tests on alpine #5933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 1 addition & 80 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,83 +12,4 @@ trigger:
- UPGRADING.INTERNALS

jobs:
- template: azure/job.yml
parameters:
configurationName: DEBUG_NTS
configurationParameters: '--enable-debug --disable-zts'
- template: azure/job.yml
parameters:
configurationName: RELEASE_ZTS
configurationParameters: '--disable-debug --enable-zts'
- template: azure/i386/job.yml
parameters:
configurationName: I386_DEBUG_ZTS
configurationParameters: '--enable-debug --enable-zts'
- template: azure/macos/job.yml
parameters:
configurationName: MACOS_DEBUG_NTS
configurationParameters: '--enable-debug --disable-zts'
- ${{ if eq(variables['Build.Reason'], 'Schedule') }}:
- template: azure/job.yml
parameters:
configurationName: DEBUG_ZTS
configurationParameters: '--enable-debug --enable-zts'
- template: azure/job.yml
parameters:
configurationName: RELEASE_NTS
configurationParameters: '--disable-debug --disable-zts'
- template: azure/i386/job.yml
parameters:
configurationName: I386_DEBUG_NTS
configurationParameters: '--enable-debug --disable-zts'
- template: azure/i386/job.yml
parameters:
configurationName: I386_RELEASE_NTS
configurationParameters: '--disable-debug --disable-zts'
- template: azure/i386/job.yml
parameters:
configurationName: I386_RELEASE_ZTS
configurationParameters: '--disable-debug --enable-zts'
- template: azure/macos/job.yml
parameters:
configurationName: MACOS_DEBUG_ZTS
configurationParameters: '--enable-debug --enable-zts'
- template: azure/macos/job.yml
parameters:
configurationName: MACOS_RELEASE_NTS
configurationParameters: '--disable-debug --disable-zts'
- template: azure/macos/job.yml
parameters:
configurationName: MACOS_RELEASE_ZTS
configurationParameters: '--disable-debug --enable-zts'
- template: azure/job.yml
parameters:
configurationName: DEBUG_ZTS_ASAN_UBSAN
configurationParameters: >-
--enable-debug --enable-zts
CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC'
LDFLAGS='-fsanitize=undefined,address'
runTestsParameters: --asan
timeoutInMinutes: 310
- template: azure/msan_job.yml
parameters:
configurationName: DEBUG_ZTS_MSAN
configurationParameters: '--enable-debug --enable-zts'
runTestsParameters: --asan
timeoutInMinutes: 90
- template: azure/community_job.yml
parameters:
configurationName: COMMUNITY
configurationParameters: >-
--enable-debug --enable-zts
CFLAGS='-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC'
LDFLAGS='-fsanitize=undefined,address'
- template: azure/coverage_job.yml
parameters:
configurationName: COVERAGE_DEBUG_ZTS
configurationParameters: '--enable-debug --disable-zts'
timeoutInMinutes: 90
- template: azure/file_cache_job.yml
parameters:
configurationName: DEBUG_NTS_FILE_CACHE
configurationParameters: '--enable-debug --disable-zts'
- template: azure/alpine_job.yml
85 changes: 85 additions & 0 deletions azure/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
FROM alpine:3.12

RUN apk add \
aspell-dev \
autoconf \
bison \
bzip2-dev \
curl-dev \
freetype-dev \
g++ \
gcc \
gettext-dev \
gnu-libiconv-dev \
gmp-dev \
icu-dev \
jpeg-dev \
libffi-dev \
libpng-dev \
libsodium-dev \
libwebp-dev \
libxml2-dev \
libxpm-dev \
libxslt-dev \
libzip-dev \
make \
oniguruma-dev \
openssl-dev \
pkgconf \
re2c \
readline-dev \
sqlite-dev \
tidyhtml-dev \
tzdata

ENV SKIP_IO_CAPTURE_TESTS=1

WORKDIR /php-src
COPY . /php-src

RUN ./buildconf
RUN ./configure \
--enable-option-checking=fatal \
--enable-debug \
--enable-werror \
--enable-phpdbg \
--enable-fpm \
--enable-bcmath \
--enable-calendar \
--enable-dba \
--enable-intl \
--enable-exif \
--enable-ftp \
--enable-gd \
--enable-mbstring \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-xmlreader \
--enable-zend-test \
--with-curl \
--with-bz2 \
--with-iconv=/usr \
--with-jpeg \
--with-ffi \
--with-freetype \
--with-gettext \
--with-gmp \
--with-openssl \
--with-pspell \
--with-readline \
--with-sodium \
--with-tidy \
--with-webp \
--with-xpm \
--with-xsl \
--with-zip \
--with-zlib

RUN make clean && make -j`nproc`
RUN sapi/cli/php run-tests.php -j`nproc` -q \
--show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP
6 changes: 6 additions & 0 deletions azure/alpine_job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jobs:
- job: ALPINE
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: docker build -f azure/Dockerfile .
4 changes: 0 additions & 4 deletions ext/date/tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ $t = mktime(0,0,0, 6, 27, 2006);
var_dump(strftime(""));
var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
var_dump(strftime("%%q %%a", $t));
var_dump(strftime("%q", $t));
var_dump(strftime("blah", $t));

var_dump(gmstrftime(""));
var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
var_dump(gmstrftime("%%q %%a", $t));
var_dump(gmstrftime("%q", $t));
var_dump(gmstrftime("blah", $t));

echo "Done\n";
Expand All @@ -29,12 +27,10 @@ bool(false)
string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
%s %"
string(5) "%q %a"
string(%d) "%s"
string(4) "blah"
bool(false)
string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
%s %"
string(5) "%q %a"
string(%d) "%s"
string(4) "blah"
Done
2 changes: 1 addition & 1 deletion ext/date/tests/bug27780.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ foreach ($timezones as $timezone) {
foreach ($timestrings as $timestring) {
$time = strtotime($timestring);

echo $time, strftime(" [%Y-%m-%d %H:%M:%S %Z]", $time), " [$timestring]\n";
echo $time, date(" [Y-m-d H:i:s T]", $time), " [$timestring]\n";
}

echo "\n";
Expand Down
1 change: 1 addition & 0 deletions ext/date/tests/bug32555.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Bug #32555 (strtotime("tomorrow") can return false)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') die('skip strftime uses system TZ');
if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--INI--
date.timezone=US/Eastern
Expand Down
1 change: 1 addition & 0 deletions ext/date/tests/bug33532.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ date.timezone=UTC
--SKIPIF--
<?php
if(PHP_OS == 'Darwin' || defined('PHP_WINDOWS_VERSION_MAJOR')) die("skip strftime uses system TZ on Darwin and Windows");
if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php
Expand Down
10 changes: 10 additions & 0 deletions ext/standard/tests/strings/setlocale_skipif.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
function require_locale(int $category, ...$locales) {
if (setlocale($category, "This locale definitely does not exist")) {
die("skip Cannot determine available locales");
}
if (!setlocale($category, ...$locales)) {
$localesStr = implode(", ", $locales);
die("skip Locales not available: $localesStr");
}
}
5 changes: 2 additions & 3 deletions ext/standard/tests/strings/setlocale_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ Test setlocale() function : usage variations - passing multiple valid/invalid lo
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) {
die('skip en_US.utf8/Ko_KR.utf8/zh_CN.utf8 locales not available');
}
require __DIR__ . '/setlocale_skipif.inc';
require_locale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8");
?>
--FILE--
<?php
Expand Down
5 changes: 2 additions & 3 deletions ext/standard/tests/strings/setlocale_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ Test setlocale() function : usage variations - setting system locale = 0
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
if (setlocale(LC_ALL,'en_US.utf8') === false) {
die('skip en_US.utf8 locale not available');
}
require __DIR__ . '/setlocale_skipif.inc';
require_locale(LC_ALL, 'en_US.utf8');
?>
--FILE--
<?php
Expand Down
5 changes: 2 additions & 3 deletions ext/standard/tests/strings/strtoupper.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
Test strtoupper on non-ASCII characters
--SKIPIF--
<?php
if (!setlocale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1")) {
die("skip locale needed for this test is not supported on this platform");
}
require __DIR__ . '/setlocale_skipif.inc';
require_locale(LC_CTYPE, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1", "ISO8859-1");
?>
--FILE--
<?php
Expand Down
9 changes: 5 additions & 4 deletions ext/standard/tests/time/strptime_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Test strptime() function : basic functionality
--SKIPIF--
<?php
if (!function_exists('strptime')) {
die("skip - strptime() function not available in this build");
}
if(PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
if (!function_exists('strptime')) {
die("skip - strptime() function not available in this build");
}
if (PHP_OS == 'Darwin') die("skip - strptime() behaves differently on Darwin");
if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php
Expand Down
7 changes: 4 additions & 3 deletions ext/standard/tests/time/strptime_parts.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Test strptime() function : basic functionality
--SKIPIF--
<?php
if (!function_exists('strptime')) {
die("skip - strptime() function not available in this build");
}
if (!function_exists('strptime')) {
die("skip - strptime() function not available in this build");
}
if (!strftime('%Z')) die('skip strftime does not support %Z');
?>
--FILE--
<?php
Expand Down