diff --git a/10/10.3/Dockerfile b/10/10.3/Dockerfile index eee2cd0..2525f9a 100644 --- a/10/10.3/Dockerfile +++ b/10/10.3/Dockerfile @@ -29,23 +29,19 @@ RUN curl -OL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait # installed into the vendor directory. RUN composer config --no-interaction allow-plugins true +# Install Drupal Dev dependencies such as PHPUnit, Behat-Mink, ... +RUN COMPOSER_MEMORY_LIMIT=-1 composer require --dev drupal/core-dev:~${DRUPAL_VERSION} + # Install Drush. # Drush will be heavily use to setup a working Drupal environment. RUN COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush:^12.0 -# Prepare for Drupal 10.3 upgrade. -# @see https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-higher -RUN composer require drupal/core-recommended:~${DRUPAL_VER} --update-with-all-dependencies --no-update -RUN composer require drupal/core-dev:~${DRUPAL_VER} --dev --update-with-all-dependencies --no-update - -# Set the minimum stability to "dev" to allow installing unstable Drupal Core. -RUN composer config minimum-stability dev - -# Perform Drupal 10.1 installation. -RUN COMPOSER_MEMORY_LIMIT=-1 composer update --with-all-dependencies - # Clean repository. RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Copy a default template for PHPUnit testing. COPY templates/phpunit.xml /opt/drupal/web/phpunit.xml + +# Create the output directory for PHPUnit. +RUN mkdir -p /opt/drupal/web/sites/default/files/simpletest/browser_output +RUN chown www-data:www-data /opt/drupal/web/sites/default/files/simpletest/browser_output diff --git a/10/10.3/Makefile b/10/10.3/Makefile index dd63cf9..6461a47 100644 --- a/10/10.3/Makefile +++ b/10/10.3/Makefile @@ -1,7 +1,7 @@ DRUPAL_VER ?= 10.3 DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+\.[0-9]+') -BASE_IMAGE_TAG = 10.2 +BASE_IMAGE_TAG = 10.3 ARCH_TO_BUILD ?= "linux/amd64" REPO = wengerk/drupal-for-contrib diff --git a/10/10.3/templates/phpunit.xml b/10/10.3/templates/phpunit.xml index 3318a24..6b39a89 100644 --- a/10/10.3/templates/phpunit.xml +++ b/10/10.3/templates/phpunit.xml @@ -22,19 +22,21 @@ - + - + - - - + @@ -80,39 +80,18 @@ - - - - - - - ./core/includes - ./core/lib - ./core/modules - - - ./core/modules/*/src/Tests - ./core/modules/*/tests - + + + ./modules - - ./modules/*/src/Tests - ./modules/*/tests - ./modules/*/*/src/Tests - ./modules/*/*/tests - - ./sites - - - ./ - ./ - - - - - - - - + + + ./modules/*/src/Tests + ./modules/*/tests + ./modules/*/*/src/Tests + ./modules/*/*/tests + ./modules/** + + diff --git a/10/10.3/tests/config.yaml b/10/10.3/tests/config.yaml index a3cc79a..5652549 100644 --- a/10/10.3/tests/config.yaml +++ b/10/10.3/tests/config.yaml @@ -34,6 +34,12 @@ commandTests: command: 'phpunit' args: ['--version'] expectedOutput: ['^PHPUnit 9\.\d\.\d'] + - name: 'PHPUnit configuration file should works' + command: 'phpunit' + args: ['-c', '/var/www/html/phpunit.xml', '--group', 'foo'] + exitCode: 0 + expectedOutput: [ 'No tests executed!' ] + excludedOutput: [ 'is not a writable directory.' ] fileExistenceTests: - name: 'Root' path: '/' @@ -62,3 +68,9 @@ fileExistenceTests: permissions: 'drwxr-xr-x' uid: 33 gid: 33 + - name: 'Drupal PHPUnit Output' + path: '/opt/drupal/web/sites/default/files/simpletest/browser_output' + shouldExist: true + permissions: 'drwxr-xr-x' + uid: 33 + gid: 33 diff --git a/README.md b/README.md index 58da437..0a0195d 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,17 @@ Overview: | `11.1` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/11/11.1/Dockerfile) | 11.x-dev | | `11.0` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/11/11.0/Dockerfile) | 11.0.x | | `10.4` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.4/Dockerfile) | 10.4-dev | -| `10.3` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.3/Dockerfile) | 10.3-dev | -| `10.2` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.2/Dockerfile) | 10.2.0+ | -| `10.1` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.1/Dockerfile) | 10.1.0+ | -| `10.0` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.0/Dockerfile) | 10.0.0+ | -| `9.5` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.5/Dockerfile) | 9.5.0+ | -| `9.4` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.4/Dockerfile) | 9.4.0+ | -| `9.3` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.3/Dockerfile) | 9.3.0+ | -| `9.2` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.2/Dockerfile) | 9.2.0+ | -| `9.1` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.1/Dockerfile) | 9.1.0+ | -| `9.0` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.0/Dockerfile) | 9.0.10+ | -| `8.9` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/8/8.9/Dockerfile) | 8.9.11+ | +| `10.3` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.3/Dockerfile) | 10.3.x | +| `10.2` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.2/Dockerfile) | 10.2.x | +| `10.1` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.1/Dockerfile) | 10.1.x | +| `10.0` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/10/10.0/Dockerfile) | 10.0.x | +| `9.5` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.5/Dockerfile) | 9.5.x | +| `9.4` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.4/Dockerfile) | 9.4.x | +| `9.3` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.3/Dockerfile) | 9.3.x | +| `9.2` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.2/Dockerfile) | 9.2.x | +| `9.1` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.1/Dockerfile) | 9.1.x | +| `9.0` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/9/9.0/Dockerfile) | 9.0.x | +| `8.9` [_(Dockerfile)_](https://github.com/wengerk/docker-drupal-for-contrib/tree/master/8/8.9/Dockerfile) | 8.9.x | ## Usage in a Drupal Contribution Modules/Themes