From 49e8aaf7e3988c0c99d4d43309e2c34d1ee065a8 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Mon, 4 Mar 2024 10:12:58 +0100 Subject: [PATCH 1/4] Update to PHP 8.3 and PHPUnit 10 --- .gitignore | 1 + Dockerfile | 10 +++++----- README.md | 2 +- bin/run.sh | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 03da585..4446ce6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Ignore PHPUnit bin download and run cache artifact bin/phpunit-9.phar +bin/phpunit-10.phar .phpunit*.cache # Ignore run artifacts diff --git a/Dockerfile b/Dockerfile index d169f3b..50d6a91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.7-cli-alpine3.18 AS build +FROM php:8.3.3-cli-alpine3.18 AS build RUN apk update && \ apk add --no-cache ca-certificates curl jo zip unzip @@ -9,19 +9,19 @@ RUN curl -L -o install-php-extensions https://github.com/mlocati/docker-php-exte chmod +x install-php-extensions && \ install-php-extensions ds-1.4.0 intl -RUN curl -L -o phpunit-9.phar https://phar.phpunit.de/phpunit-9.phar && \ - chmod +x phpunit-9.phar +RUN curl -L -o phpunit-10.phar https://phar.phpunit.de/phpunit-10.phar && \ + chmod +x phpunit-10.phar WORKDIR /usr/local/bin/junit-handler/ COPY --from=composer:2.5.8 /usr/bin/composer /usr/local/bin/composer COPY junit-handler/ . RUN composer install --no-interaction -FROM php:8.2.7-cli-alpine3.18 AS runtime +FROM php:8.3.3-cli-alpine3.18 AS runtime COPY --from=build /usr/bin/jo /usr/bin/jo COPY --from=build /usr/local/lib/php/extensions /usr/local/lib/php/extensions -COPY --from=build /usr/local/bin/phpunit-9.phar /opt/test-runner/bin/phpunit-9.phar +COPY --from=build /usr/local/bin/phpunit-10.phar /opt/test-runner/bin/phpunit-10.phar COPY --from=build /usr/local/bin/junit-handler /opt/test-runner/junit-handler # Use the default production configuration diff --git a/README.md b/README.md index a8c8999..a8e5866 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is a minimal test runner for Exercism's v3 platform. It meets the minimal ### Dockerimage -The website uses isolated docker images to run untrusted code in a sandbox. Image consists of PHP 8.2.7 (PHPUnit 9/10). All final assets are built into the image, because the image does not have network access once in use. +The website uses isolated docker images to run untrusted code in a sandbox. Image consists of PHP 8.3.3 (PHPUnit 9/10). All final assets are built into the image, because the image does not have network access once in use. Includes php extensions: ds, intl diff --git a/bin/run.sh b/bin/run.sh index 462a3a2..5b50328 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -2,7 +2,7 @@ set -euo pipefail -PHPUNIT_BIN="./bin/phpunit-9.phar" +PHPUNIT_BIN="./bin/phpunit-10.phar" XML_RESULTS='results.xml' JSON_RESULTS='results.json' From e6d9538e3e79781cc3bd09e3f35fdb42971bfa5b Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Mon, 4 Mar 2024 11:28:44 +0100 Subject: [PATCH 2/4] Disable XDEBUG in testing --- bin/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/run.sh b/bin/run.sh index 5b50328..860e317 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -5,6 +5,7 @@ set -euo pipefail PHPUNIT_BIN="./bin/phpunit-10.phar" XML_RESULTS='results.xml' JSON_RESULTS='results.json' +XDEBUG_MODE='off' function main { exercise_slug="${1}" From 3ffc612c78935c7d64611e9dbfcf3f99a086e6fe Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Mon, 4 Mar 2024 11:42:45 +0100 Subject: [PATCH 3/4] Update ds to 1.5.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 50d6a91..e96c0f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /usr/local/bin RUN curl -L -o install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \ chmod +x install-php-extensions && \ - install-php-extensions ds-1.4.0 intl + install-php-extensions ds-1.5.0 intl RUN curl -L -o phpunit-10.phar https://phar.phpunit.de/phpunit-10.phar && \ chmod +x phpunit-10.phar From 6ef4aad5511d15180758a0bf933e8c5dc76201d1 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Tue, 5 Mar 2024 12:21:16 +0100 Subject: [PATCH 4/4] Remove Verbose flag is not supported anymore --- bin/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/run.sh b/bin/run.sh index 860e317..8e9c953 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -17,7 +17,6 @@ function main { phpunit_output=$(eval "${PHPUNIT_BIN}" \ -d memory_limit=300M \ --log-junit "${output_dir%/}/${XML_RESULTS}" \ - --verbose \ --no-configuration \ --do-not-cache-result \ "${test_files%%*( )}" 2>&1)