Skip to content

Commit 34465e5

Browse files
Added tests for "Improved Granularity for SQL Databases" (#763)
* Prepare for v1.6 release * Prepare for v1.6.1 release * Fixed "Improved Granularity for SQL Databases" * Added php-sqlite to Dockerfile-s * Added diagnostics to debug test failures * Align names with acronyms * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Prepare for v1.6 release * Fixed "Improved Granularity for SQL Databases" * Added php-sqlite to Dockerfile-s * Added diagnostics to debug test failures * Align names with acronyms * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Added diagnostics to debug test failures * Try various combination of installing SQLite PHP extension * Added diagnostics to debug test failures * Shift PHP ext install after update-alternatives * Temporarily delete docker image to force rebuilding it * Added apt-transport-https * Update fpm test Dockerfile * Removed Temporary delete docker image to force rebuilding it * COMPONENT_TEST_SCRIPT should not wrapped in quotes at the last point * Fixed formatting
1 parent 7bbc07b commit 34465e5

File tree

85 files changed

+2126
-489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2126
-489
lines changed

composer.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,24 @@
8585
"run_component_tests_configured_filter": [
8686
"phpunit -c phpunit_component_tests.xml --filter"
8787
],
88+
"run_component_tests_cli_filter": [
89+
"ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script phpunit -c phpunit_component_tests.xml --filter"
90+
],
91+
"run_component_tests_http_filter": [
92+
"ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server phpunit -c phpunit_component_tests.xml --filter"
93+
],
8894
"run_component_tests": [
8995
"composer run-script run_component_tests_http",
9096
"composer run-script run_component_tests_cli"
9197
],
92-
"run_component_tests_http": [
98+
"run_component_tests_cli": [
9399
"@putenv ELASTIC_APM_ENABLED=false",
94-
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server",
100+
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script",
95101
"composer run-script run_component_tests_configured"
96102
],
97-
"run_component_tests_cli": [
103+
"run_component_tests_http": [
98104
"@putenv ELASTIC_APM_ENABLED=false",
99-
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script",
105+
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server",
100106
"composer run-script run_component_tests_configured"
101107
],
102108
"run_tests": [

packaging/Makefile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ build-docker-images: prepare prepare-apk prepare-deb prepare-rpm prepare-tar pre
2929

3030
create-%: prepare ## Create the specific package
3131
@echo "Creating package $* ..."
32-
@mkdir -p $(PWD)/$(OUTPUT)
33-
@docker run --rm \
32+
mkdir -p $(PWD)/$(OUTPUT)
33+
docker run --rm \
3434
-v $(PWD):/app \
3535
-e TYPE=$* \
3636
-e NAME=$(NAME) \
37-
-e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) \
37+
-e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" \
3838
-e VERSION=$(VERSION) \
3939
-e OUTPUT=$(OUTPUT) \
4040
-e FPM_FLAGS=${FPM_FLAGS} \
@@ -98,7 +98,7 @@ prepare-apk: ## Build the docker image for the apk smoke tests
9898

9999
.PHONY: prepare-deb-apache
100100
prepare-deb-apache: ## Build the docker image for the deb smoke tests for apache
101-
@cd $(PWD)/packaging/test/ubuntu ;\
101+
cd $(PWD)/packaging/test/ubuntu ;\
102102
docker build --file apache/Dockerfile --build-arg PHP_VERSION=$(PHP_VERSION) --tag $@ . ;\
103103
cd -
104104

@@ -128,46 +128,46 @@ prepare-rpm: ## Build the docker image for the rpm smoke tests
128128

129129
.PHONY: apk-install
130130
apk-install: prepare-apk ## Install the apk installer to run some smoke tests
131-
@docker run --rm -v $(PWD):/src -w /src -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-apk
131+
@docker run --rm -v $(PWD):/src -w /src -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-apk
132132

133133
.PHONY: deb-install
134134
deb-install: prepare-deb ## Install the deb installer to run some smoke tests
135-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb
135+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb
136136

137137
.PHONY: tar-install
138138
tar-install: prepare-tar ## Install the tar installer to run some smoke tests
139-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=tar -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-tar
139+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=tar -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-tar
140140

141141
.PHONY: rpm-install
142142
rpm-install: prepare-rpm ## Install the rpm installer to run some smoke tests
143-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=rpm -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
143+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=rpm -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
144144

145145
.PHONY: deb-install-in-apache
146146
deb-install-in-apache: prepare-deb-apache ## Install the deb installer to run some smoke tests in apache
147-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb-apache
147+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb-apache
148148

149149
.PHONY: deb-install-in-fpm
150150
deb-install-in-fpm: prepare-deb-fpm ## Install the deb installer to run some smoke tests in fpm
151-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb-fpm
151+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb-fpm
152152

153153
.PHONY: install
154154
install: apk-install deb-install rpm-install tar-install ## Install all the distributions
155155

156156
.PHONY: apk-install-release-github
157157
apk-install-release-github: prepare-apk ## Install the apk installer from a given release to run some smoke tests
158-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-apk
158+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-apk
159159

160160
.PHONY: deb-install-release-github
161161
deb-install-release-github: prepare-deb ## Install the deb installer from a given release to run some smoke tests
162-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb
162+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb
163163

164164
.PHONY: rpm-install-release-github
165165
rpm-install-release-github: prepare-rpm ## Install the rpm installer from a given release to run some smoke tests
166-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
166+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=release-github -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
167167

168168
.PHONY: tar-install-release-github
169169
tar-install-release-github: prepare-tar ## Install the tar installer from a given release to run some smoke tests
170-
@docker run --rm -v $(PWD):/src -w /src -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e VERSION=$(RELEASE_VERSION) -e TYPE=release-tar-github -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-tar
170+
@docker run --rm -v $(PWD):/src -w /src -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e VERSION=$(RELEASE_VERSION) -e TYPE=release-tar-github -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-tar
171171

172172
.PHONY: install-release-github
173173
install-release-github: apk-install-release-github deb-install-release-github rpm-install-release-github tar-install-release-github ## Install all the distributions for a given release using the downloaded binaries
@@ -177,45 +177,45 @@ lifecycle-testing: apk-lifecycle-testing deb-lifecycle-testing rpm-lifecycle-tes
177177

178178
.PHONY: apk-lifecycle-testing
179179
apk-lifecycle-testing: prepare-apk ## Lifecycle testing for the apk installer
180-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=apk-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-apk
180+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=apk-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-apk
181181

182182
.PHONY: deb-lifecycle-testing
183183
deb-lifecycle-testing: prepare-deb ## Lifecycle testing for the deb installer
184-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb
184+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb
185185

186186
.PHONY: deb-lifecycle-testing-in-apache
187187
deb-lifecycle-testing-in-apache: prepare-deb-apache ## Lifecycle testing for the deb installer with apache
188-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb-apache
188+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb-apache
189189

190190
.PHONY: deb-lifecycle-testing-in-fpm
191191
deb-lifecycle-testing-in-fpm: prepare-deb-fpm ## Lifecycle testing for the deb installer with fpm
192-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb-fpm
192+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=deb-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb-fpm
193193

194194
.PHONY: rpm-lifecycle-testing
195195
rpm-lifecycle-testing: prepare-rpm ## Lifecycle testing for the rpm installer
196-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=rpm-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
196+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=rpm-uninstall -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
197197

198198
.PHONY: tar-lifecycle-testing
199199
tar-lifecycle-testing: prepare-tar ## Lifecycle testing for the tar installer
200-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=tar-uninstall -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-tar
200+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=tar-uninstall -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-tar
201201

202202
.PHONY: rpm-php-upgrade-testing
203203
rpm-php-upgrade-testing: PHP_VERSION="7.2" ### Force the PHP version to start with.
204204
rpm-php-upgrade-testing: prepare-rpm ## PHP upgrade, from 7.2 to 7.4, testing for the rpm installer
205-
@docker run --rm -v $(PWD):/src -w /src -e TYPE=php-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
205+
@docker run --rm -v $(PWD):/src -w /src -e TYPE=php-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
206206

207207
.PHONY: rpm-agent-upgrade-testing
208208
rpm-agent-upgrade-testing: prepare-rpm ## Agent upgrade, from 1.0.0 to the current generated one, testing for the rpm installer
209-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
209+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
210210

211211
.PHONY: deb-agent-upgrade-testing
212212
deb-agent-upgrade-testing: prepare-deb ## Agent upgrade, from 1.0.0 to the current generated one, testing for the deb installer
213-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb
213+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb
214214

215215
.PHONY: rpm-agent-upgrade-testing-local
216216
rpm-agent-upgrade-testing-local: prepare-rpm ## Agent upgrade, from 1.0.0 to the current generated one, testing for the rpm installer
217-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade-local -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-rpm
217+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade-local -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-rpm
218218

219219
.PHONY: deb-agent-upgrade-testing-local
220220
deb-agent-upgrade-testing-local: prepare-deb ## Agent upgrade, from 1.0.0 to the current generated one, testing for the deb installer
221-
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade-local -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) prepare-deb
221+
@docker run --rm -v $(PWD):/src -w /src -e VERSION=$(RELEASE_VERSION) -e GITHUB_RELEASES_URL=$(GITHUB_RELEASES_URL) -e TYPE=agent-upgrade-local -e PACKAGE=$(NAME) -e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" prepare-deb

packaging/test/alpine/entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,20 @@ validate_installation() {
4747
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
4848
export ELASTIC_APM_ENABLED=false
4949

50+
echo 'PHP version:'
51+
php -v
52+
echo 'Installed PHP extensions:'
53+
php -m
54+
echo 'Set environment variables:'
55+
set | grep ELASTIC || true
56+
5057
## Validate the installation works as expected with composer
5158
composer install
5259
syslogd
5360
## This env variable can be overriden
54-
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
55-
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
61+
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
62+
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
63+
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
5664
echo 'Something bad happened when running the tests, see the output from the syslog'
5765
cat /var/log/messages
5866
exit 1

packaging/test/centos/entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ function validate_installation() {
5151
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
5252
export ELASTIC_APM_ENABLED=false
5353

54+
echo 'PHP version:'
55+
php -v
56+
echo 'Installed PHP extensions:'
57+
php -m
58+
echo 'Set environment variables:'
59+
set | grep ELASTIC || true
60+
5461
## Validate the installation works as expected with composer
5562
composer install
5663
/usr/sbin/rsyslogd
5764
## This env variable can be overriden
58-
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
59-
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
65+
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
66+
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
67+
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
6068
echo 'Something bad happened when running the tests, see the output from the syslog'
6169
cat /var/log/syslog
6270
exit 1

packaging/test/ubuntu/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ COPY --from=composer:2.3.5 /usr/bin/composer /usr/bin/composer
77
# sh: 1: git: not found
88
# the zip extension and unzip command are both missing, skipping.
99
RUN apt-get -qq update \
10-
&& apt-get -qq install -y dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog --no-install-recommends \
10+
&& apt-get -qq install -y \
11+
dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog \
12+
--no-install-recommends \
1113
&& rm -rf /var/lib/apt/lists/*
1214

1315
ENV TYPE=deb

packaging/test/ubuntu/apache/Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ FROM ubuntu:20.04
22
ENV DEBIAN_FRONTEND=noninteractive
33

44
RUN apt-get -qq update \
5-
&& apt-get -qq install -y dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog --no-install-recommends
5+
&& apt-get -qq -y --no-install-recommends install apt-utils \
6+
&& apt-get -qq -y --no-install-recommends install apt-transport-https dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog
67

78
COPY --from=composer:2.3.5 /usr/bin/composer /usr/bin/composer
89

@@ -11,10 +12,18 @@ COPY entrypoint.sh /bin
1112
## Install the specific PHP version in addition with apache2
1213
ARG PHP_VERSION=7.2
1314
ENV PHP_VERSION=$PHP_VERSION
14-
RUN apt-get -qq install -y software-properties-common --no-install-recommends \
15+
RUN apt-get -qq -y --no-install-recommends install software-properties-common \
1516
&& add-apt-repository ppa:ondrej/php \
1617
&& apt-get -qq update \
17-
&& apt-get -qq install -y apache2 libapache2-mod-php php${PHP_VERSION}-curl php${PHP_VERSION}-mysql php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION} \
18+
&& apt-get -qq -y --no-install-recommends install \
19+
apache2 \
20+
php${PHP_VERSION} \
21+
libapache2-mod-php \
22+
php${PHP_VERSION}-curl \
23+
php${PHP_VERSION}-mbstring \
24+
php${PHP_VERSION}-mysql \
25+
php${PHP_VERSION}-sqlite \
26+
php${PHP_VERSION}-xml \
1827
&& rm -rf /var/lib/apt/lists/*
1928

2029
## Enable the new installed PHP version.

packaging/test/ubuntu/entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ function validate_installation() {
5151
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
5252
export ELASTIC_APM_ENABLED=false
5353

54+
echo 'PHP version:'
55+
php -v
56+
echo 'Installed PHP extensions:'
57+
php -m
58+
echo 'Set environment variables:'
59+
set | grep ELASTIC || true
60+
5461
## Validate the installation works as expected with composer
5562
composer install
5663
/usr/sbin/rsyslogd
5764
## This env variable can be overriden
58-
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
59-
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
65+
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
66+
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
67+
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
6068
echo 'Something bad happened when running the tests, see the output from the syslog'
6169
cat /var/log/syslog
6270
exit 1

packaging/test/ubuntu/fpm/Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ FROM ubuntu:20.04
22
ENV DEBIAN_FRONTEND=noninteractive
33

44
RUN apt-get -qq update \
5-
&& apt-get -qq install -y dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog --no-install-recommends
5+
&& apt-get -qq -y --no-install-recommends install apt-utils \
6+
&& apt-get -qq -y --no-install-recommends install apt-transport-https dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog
67

78
COPY --from=composer:2.3.5 /usr/bin/composer /usr/bin/composer
89

@@ -11,10 +12,19 @@ COPY entrypoint.sh /bin
1112
## Install the specific PHP version in addition with fpm and apache
1213
ARG PHP_VERSION=7.2
1314
ENV PHP_VERSION=$PHP_VERSION
14-
RUN apt-get -qq install -y software-properties-common --no-install-recommends \
15+
RUN apt-get -qq -y --no-install-recommends install software-properties-common \
1516
&& add-apt-repository ppa:ondrej/php \
1617
&& apt-get -qq update \
17-
&& apt-get -qq install -y apache2 libapache2-mod-fcgid php${PHP_VERSION}-curl php${PHP_VERSION}-fpm php${PHP_VERSION}-mbstring php${PHP_VERSION}-mysql php${PHP_VERSION}-xml php${PHP_VERSION} \
18+
&& apt-get -qq -y --no-install-recommends install \
19+
apache2 \
20+
php${PHP_VERSION} \
21+
libapache2-mod-fcgid \
22+
php${PHP_VERSION}-curl \
23+
php${PHP_VERSION}-fpm \
24+
php${PHP_VERSION}-mbstring \
25+
php${PHP_VERSION}-mysql \
26+
php${PHP_VERSION}-sqlite \
27+
php${PHP_VERSION}-xml \
1828
&& rm -rf /var/lib/apt/lists/*
1929

2030
## Enabled the just installed PHP and the fcgi.

0 commit comments

Comments
 (0)