Skip to content

Commit 8400a96

Browse files
committed
Fix tests for refactored debian-8-php7
Disabled xdebug because it's not available for debian sury Also readded dotdeb template macro
1 parent b15c04e commit 8400a96

File tree

7 files changed

+64
-7
lines changed

7 files changed

+64
-7
lines changed

docker/php-dev/debian-8-php7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN /usr/local/bin/apt-install \
1717
# Install tools
1818
graphviz \
1919
# Install php development stuff
20-
php7.0-xdebug \
20+
# php7.0-xdebug \ # Is currently not available
2121
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-php-dev \
2222
&& /opt/docker/bin/bootstrap.sh
2323

docker/php/debian-8-php7/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ENV WEB_ALIAS_DOMAIN *.vm
1616

1717
COPY conf/ /opt/docker/
1818

19-
# Install php environment
2019
RUN /usr/local/bin/apt-install apt-transport-https lsb-release \
2120
&& echo "deb https://packages.sury.org/php/ jessie main" >> /etc/apt/sources.list \
2221
&& echo "deb http://ftp2.de.debian.org/debian/ testing main" >> /etc/apt/sources.list \
@@ -51,6 +50,10 @@ RUN /usr/local/bin/apt-install apt-transport-https lsb-release \
5150
php7.0-bz2 \
5251
php7.0-redis \
5352
php7.0-memcached \
53+
php7.0-zip \
54+
php7.0-soap \
55+
php7.0-bcmath \
56+
php7.0-mbstring \
5457
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \
5558
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-php \
5659
&& /opt/docker/bin/bootstrap.sh

template/Dockerfile/images/php7-dev.jinja2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ RUN /usr/local/bin/apt-install \
3232
{{ provision.runRoleInline('php-dev', role) }}
3333
{%- endmacro %}
3434

35+
{% macro debianDotDeb(role='') -%}
36+
# Install development environment
37+
RUN /usr/local/bin/apt-install \
38+
# Install tools
39+
graphviz \
40+
# Install php development stuff
41+
php7.0-xdebug \
42+
{{ provision.runRoleInline('php-dev', role) }}
43+
{%- endmacro %}
44+
3545
{% macro debianSury(role='') -%}
3646
# Install development environment
3747
RUN /usr/local/bin/apt-install \

template/Dockerfile/images/php7.jinja2

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,36 @@ RUN /usr/local/bin/apk-install \
6363
{{ provision.runRoleInline('php', role) }}
6464
{%- endmacro %}
6565

66+
{% macro debianDotDeb(distribution,role='') -%}
67+
# Install php environment
68+
RUN echo "deb http://packages.dotdeb.org {{ distribution }} all" >> /etc/apt/sources.list \
69+
&& echo "deb-src http://packages.dotdeb.org {{ distribution }} all" >> /etc/apt/sources.list \
70+
&& wget -O- https://www.dotdeb.org/dotdeb.gpg | apt-key add - \
71+
&& /usr/local/bin/apt-install \
72+
# Install tools
73+
imagemagick \
74+
graphicsmagick \
75+
# Install php (cli/fpm)
76+
php7.0-cli \
77+
php7.0-fpm \
78+
php7.0-json \
79+
php7.0-intl \
80+
php7.0-curl \
81+
php7.0-mysql \
82+
php7.0-mcrypt \
83+
php7.0-gd \
84+
php7.0-sqlite3 \
85+
php7.0-ldap \
86+
php7.0-opcache \
87+
php7.0-xmlrpc \
88+
php7.0-xsl \
89+
php7.0-bz2 \
90+
php7.0-redis \
91+
php7.0-memcached \
92+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \
93+
{{ provision.runRoleInline('php', role) }}
94+
{%- endmacro %}
95+
6696
{% macro debianSury(distribution,role='') -%}
6797
RUN /usr/local/bin/apt-install apt-transport-https lsb-release \
6898
&& echo "deb https://packages.sury.org/php/ {{ distribution }} main" >> /etc/apt/sources.list \
@@ -98,6 +128,10 @@ RUN /usr/local/bin/apt-install apt-transport-https lsb-release \
98128
php7.0-bz2 \
99129
php7.0-redis \
100130
php7.0-memcached \
131+
php7.0-zip \
132+
php7.0-soap \
133+
php7.0-bcmath \
134+
php7.0-mbstring \
101135
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \
102136
{{ provision.runRoleInline('php', role) }}
103137
{%- endmacro %}

test/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ initEnvironment
395395
OS_VERSION="$DOCKER_TAG_LATEST" runTestForTag "latest"
396396

397397
setEnvironmentOsFamily "debian"
398-
OS_VERSION="8" runTestForTag "debian-8-php7"
398+
PHP_XDEBUG=0 OS_VERSION="8" runTestForTag "debian-8-php7"
399399
OS_VERSION="testing" runTestForTag "debian-9"
400400

401401
setEnvironmentOsFamily "alpine"
@@ -551,7 +551,7 @@ initEnvironment
551551
OS_VERSION="$DOCKER_TAG_LATEST" runTestForTag "latest"
552552

553553
setEnvironmentOsFamily "debian"
554-
OS_VERSION="8" runTestForTag "debian-8-php7"
554+
PHP_XDEBUG=0 OS_VERSION="8" runTestForTag "debian-8-php7"
555555
OS_VERSION="testing" runTestForTag "debian-9"
556556

557557
setEnvironmentOsFamily "alpine"
@@ -651,7 +651,7 @@ initEnvironment
651651
OS_VERSION="$DOCKER_TAG_LATEST" runTestForTag "latest"
652652

653653
setEnvironmentOsFamily "debian"
654-
OS_VERSION="8" runTestForTag "debian-8-php7"
654+
PHP_XDEBUG=0 OS_VERSION="8" runTestForTag "debian-8-php7"
655655
OS_VERSION="testing" runTestForTag "debian-9"
656656

657657
setEnvironmentOsFamily "alpine"

test/spec/shared/php/modules.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474

7575
shared_examples 'php::modules::development' do
7676
describe command('php -m') do
77-
its(:stdout) { should contain('xdebug') }
77+
if ( $testConfiguration[:phpXdebug] )
78+
its(:stdout) { should contain('xdebug') }
79+
end
7880

7981
its(:exit_status) { should eq 0 }
8082
end
@@ -187,7 +189,10 @@
187189

188190
shared_examples 'php-fpm::modules::development' do
189191
describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do
190-
its(:stdout) { should contain('xdebug') }
192+
193+
if ( $testConfiguration[:phpXdebug] )
194+
its(:stdout) { should contain('xdebug') }
195+
end
191196

192197
its(:exit_status) { should eq 0 }
193198
end

test/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
$testConfiguration[:ansiblePath] = "/usr/local/bin"
2525
end
2626

27+
$testConfiguration[:phpXdebug] = true
28+
29+
if ENV['PHP_XDEBUG'] and ENV['PHP_XDEBUG'] == "0"
30+
$testConfiguration[:phpXdebug] = false
31+
end
2732

2833
def wait_retry(time, increment = 1, elapsed_time = 0, &block)
2934
begin

0 commit comments

Comments
 (0)