Skip to content

Commit

Permalink
Added tests for "Improved Granularity for SQL Databases" (#763)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
SergeyKleyman authored Sep 10, 2022
1 parent 7bbc07b commit 34465e5
Show file tree
Hide file tree
Showing 85 changed files with 2,126 additions and 489 deletions.
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,24 @@
"run_component_tests_configured_filter": [
"phpunit -c phpunit_component_tests.xml --filter"
],
"run_component_tests_cli_filter": [
"ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script phpunit -c phpunit_component_tests.xml --filter"
],
"run_component_tests_http_filter": [
"ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server phpunit -c phpunit_component_tests.xml --filter"
],
"run_component_tests": [
"composer run-script run_component_tests_http",
"composer run-script run_component_tests_cli"
],
"run_component_tests_http": [
"run_component_tests_cli": [
"@putenv ELASTIC_APM_ENABLED=false",
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server",
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script",
"composer run-script run_component_tests_configured"
],
"run_component_tests_cli": [
"run_component_tests_http": [
"@putenv ELASTIC_APM_ENABLED=false",
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=CLI_script",
"@putenv ELASTIC_APM_PHP_TESTS_APP_CODE_HOST_KIND=Builtin_HTTP_server",
"composer run-script run_component_tests_configured"
],
"run_tests": [
Expand Down
50 changes: 25 additions & 25 deletions packaging/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ build-docker-images: prepare prepare-apk prepare-deb prepare-rpm prepare-tar pre

create-%: prepare ## Create the specific package
@echo "Creating package $* ..."
@mkdir -p $(PWD)/$(OUTPUT)
@docker run --rm \
mkdir -p $(PWD)/$(OUTPUT)
docker run --rm \
-v $(PWD):/app \
-e TYPE=$* \
-e NAME=$(NAME) \
-e COMPONENT_TEST_SCRIPT=$(COMPONENT_TEST_SCRIPT) \
-e COMPONENT_TEST_SCRIPT="$(COMPONENT_TEST_SCRIPT)" \
-e VERSION=$(VERSION) \
-e OUTPUT=$(OUTPUT) \
-e FPM_FLAGS=${FPM_FLAGS} \
Expand Down Expand Up @@ -98,7 +98,7 @@ prepare-apk: ## Build the docker image for the apk smoke tests

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

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

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

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

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

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

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

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

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

.PHONY: apk-install-release-github
apk-install-release-github: prepare-apk ## Install the apk installer from a given release to run some smoke tests
@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
@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

.PHONY: deb-install-release-github
deb-install-release-github: prepare-deb ## Install the deb installer from a given release to run some smoke tests
@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
@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

.PHONY: rpm-install-release-github
rpm-install-release-github: prepare-rpm ## Install the rpm installer from a given release to run some smoke tests
@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
@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

.PHONY: tar-install-release-github
tar-install-release-github: prepare-tar ## Install the tar installer from a given release to run some smoke tests
@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
@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

.PHONY: install-release-github
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
Expand All @@ -177,45 +177,45 @@ lifecycle-testing: apk-lifecycle-testing deb-lifecycle-testing rpm-lifecycle-tes

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

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

.PHONY: deb-lifecycle-testing-in-apache
deb-lifecycle-testing-in-apache: prepare-deb-apache ## Lifecycle testing for the deb installer with apache
@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
@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

.PHONY: deb-lifecycle-testing-in-fpm
deb-lifecycle-testing-in-fpm: prepare-deb-fpm ## Lifecycle testing for the deb installer with fpm
@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
@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

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

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

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

.PHONY: rpm-agent-upgrade-testing
rpm-agent-upgrade-testing: prepare-rpm ## Agent upgrade, from 1.0.0 to the current generated one, testing for the rpm installer
@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
@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

.PHONY: deb-agent-upgrade-testing
deb-agent-upgrade-testing: prepare-deb ## Agent upgrade, from 1.0.0 to the current generated one, testing for the deb installer
@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
@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

.PHONY: rpm-agent-upgrade-testing-local
rpm-agent-upgrade-testing-local: prepare-rpm ## Agent upgrade, from 1.0.0 to the current generated one, testing for the rpm installer
@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
@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

.PHONY: deb-agent-upgrade-testing-local
deb-agent-upgrade-testing-local: prepare-deb ## Agent upgrade, from 1.0.0 to the current generated one, testing for the deb installer
@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
@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
12 changes: 10 additions & 2 deletions packaging/test/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,20 @@ validate_installation() {
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
export ELASTIC_APM_ENABLED=false

echo 'PHP version:'
php -v
echo 'Installed PHP extensions:'
php -m
echo 'Set environment variables:'
set | grep ELASTIC || true

## Validate the installation works as expected with composer
composer install
syslogd
## This env variable can be overriden
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
echo 'Something bad happened when running the tests, see the output from the syslog'
cat /var/log/messages
exit 1
Expand Down
12 changes: 10 additions & 2 deletions packaging/test/centos/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ function validate_installation() {
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
export ELASTIC_APM_ENABLED=false

echo 'PHP version:'
php -v
echo 'Installed PHP extensions:'
php -m
echo 'Set environment variables:'
set | grep ELASTIC || true

## Validate the installation works as expected with composer
composer install
/usr/sbin/rsyslogd
## This env variable can be overriden
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
echo 'Something bad happened when running the tests, see the output from the syslog'
cat /var/log/syslog
exit 1
Expand Down
4 changes: 3 additions & 1 deletion packaging/test/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ COPY --from=composer:2.3.5 /usr/bin/composer /usr/bin/composer
# sh: 1: git: not found
# the zip extension and unzip command are both missing, skipping.
RUN apt-get -qq update \
&& apt-get -qq install -y dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog --no-install-recommends \
&& apt-get -qq install -y \
dpkg-sig gnupg gnupg2 git procps zlib1g-dev libzip-dev wget unzip rsyslog \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENV TYPE=deb
Expand Down
15 changes: 12 additions & 3 deletions packaging/test/ubuntu/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

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

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

Expand All @@ -11,10 +12,18 @@ COPY entrypoint.sh /bin
## Install the specific PHP version in addition with apache2
ARG PHP_VERSION=7.2
ENV PHP_VERSION=$PHP_VERSION
RUN apt-get -qq install -y software-properties-common --no-install-recommends \
RUN apt-get -qq -y --no-install-recommends install software-properties-common \
&& add-apt-repository ppa:ondrej/php \
&& apt-get -qq update \
&& 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} \
&& apt-get -qq -y --no-install-recommends install \
apache2 \
php${PHP_VERSION} \
libapache2-mod-php \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-sqlite \
php${PHP_VERSION}-xml \
&& rm -rf /var/lib/apt/lists/*

## Enable the new installed PHP version.
Expand Down
12 changes: 10 additions & 2 deletions packaging/test/ubuntu/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ function validate_installation() {
# Disable Elastic APM for any process outside the component tests to prevent noise in the logs
export ELASTIC_APM_ENABLED=false

echo 'PHP version:'
php -v
echo 'Installed PHP extensions:'
php -m
echo 'Set environment variables:'
set | grep ELASTIC || true

## Validate the installation works as expected with composer
composer install
/usr/sbin/rsyslogd
## This env variable can be overriden
COMPONENT_TEST_SCRIPT="${COMPONENT_TEST_SCRIPT:-run_component_tests}"
if ! composer run-script "${COMPONENT_TEST_SCRIPT}" ; then
## COMPONENT_TEST_SCRIPT is not wrapped in quotes on purpose because it might contained multiple space separated strings
COMPONENT_TEST_SCRIPT=${COMPONENT_TEST_SCRIPT:-run_component_tests}
if ! composer run-script ${COMPONENT_TEST_SCRIPT} ; then
echo 'Something bad happened when running the tests, see the output from the syslog'
cat /var/log/syslog
exit 1
Expand Down
16 changes: 13 additions & 3 deletions packaging/test/ubuntu/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

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

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

Expand All @@ -11,10 +12,19 @@ COPY entrypoint.sh /bin
## Install the specific PHP version in addition with fpm and apache
ARG PHP_VERSION=7.2
ENV PHP_VERSION=$PHP_VERSION
RUN apt-get -qq install -y software-properties-common --no-install-recommends \
RUN apt-get -qq -y --no-install-recommends install software-properties-common \
&& add-apt-repository ppa:ondrej/php \
&& apt-get -qq update \
&& 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} \
&& apt-get -qq -y --no-install-recommends install \
apache2 \
php${PHP_VERSION} \
libapache2-mod-fcgid \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-sqlite \
php${PHP_VERSION}-xml \
&& rm -rf /var/lib/apt/lists/*

## Enabled the just installed PHP and the fcgi.
Expand Down
Loading

0 comments on commit 34465e5

Please sign in to comment.