Skip to content

Commit

Permalink
add stable drupal 10.3 image
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Sep 11, 2024
1 parent 46b6c03 commit f7c72ea
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 65 deletions.
18 changes: 7 additions & 11 deletions 10/10.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion 10/10.3/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
63 changes: 21 additions & 42 deletions 10/10.3/templates/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
<ini name="memory_limit" value="-1"/>
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<env name="SIMPLETEST_BASE_URL" value="http://drupal"/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/database_name#table_prefix -->
<env name="SIMPLETEST_DB" value="mysql://drupal:drupal@db/drupal"/>
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/opt/drupal/web/sites/default/files/simpletest/browser_output"/>
<!-- To have browsertest output use an alternative base URL. For example if
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the
external DDev URL so you can follow the links directly.
-->
<!-- By default, browser tests will output links that use the base URL set
in SIMPLETEST_BASE_URL. However, if your SIMPLETEST_BASE_URL is an internal
path (such as may be the case in a virtual or Docker-based environment),
you can set the base URL used in the browser test output links to something
reachable from your host machine here. This will allow you to follow them
directly and view the output. -->
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>

<!-- Deprecation testing is managed through Symfony's PHPUnit Bridge.
The environment variable SYMFONY_DEPRECATIONS_HELPER is used to configure
the behaviour of the deprecation tests.
the behavior of the deprecation tests.
See https://symfony.com/doc/current/components/phpunit_bridge.html#configuration
Drupal core's testing framework is setting this variable to its defaults.
Projects with their own requirements need to manage this variable
Expand All @@ -51,13 +53,11 @@
-->
<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=.deprecation-ignore.txt"/> -->

<!-- To disable deprecation testing completely uncomment the next line. -->
<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/> -->
<!-- Example for changing the driver class for mink tests MINK_DRIVER_CLASS value: 'Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver' -->
<env name="MINK_DRIVER_CLASS" value=''/>
<!-- Example for changing the driver args to mink tests MINK_DRIVER_ARGS value: '["http://127.0.0.1:8510"]' -->
<env name="MINK_DRIVER_ARGS" value=''/>
<!-- Example for changing the driver args to webdriver tests MINK_DRIVER_ARGS_WEBDRIVER value: '["chrome", { "chromeOptions": { "w3c": false } }, "http://localhost:4444/wd/hub"]' For using the Firefox browser, replace "chrome" with "firefox" -->
<!-- Example for changing the driver args to webdriver tests MINK_DRIVER_ARGS_WEBDRIVER value: '["chrome", { "goog:chromeOptions": { "w3c": false } }, "http://localhost:4444/wd/hub"]' For using the Firefox browser, replace "chrome" with "firefox" -->
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]'/>
</php>
<testsuites>
Expand All @@ -80,39 +80,18 @@
<listeners>
<listener class="\Drupal\Tests\Listeners\DrupalListener">
</listener>
<!-- The Symfony deprecation listener has to come after the Drupal listener -->
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
</listener>
</listeners>
<!-- Filter for coverage reports. -->
<filter>
<whitelist>
<directory>./core/includes</directory>
<directory>./core/lib</directory>
<directory>./core/modules</directory>
<!-- Extensions can have their own test directories, so exclude those. -->
<exclude>
<directory>./core/modules/*/src/Tests</directory>
<directory>./core/modules/*/tests</directory>
</exclude>
<!-- Settings for coverage reports. -->
<coverage>
<include>
<directory>./modules</directory>
<exclude>
<directory>./modules/*/src/Tests</directory>
<directory>./modules/*/tests</directory>
<directory>./modules/*/*/src/Tests</directory>
<directory>./modules/*/*/tests</directory>
</exclude>
<directory>./sites</directory>
<!-- By definition test classes have no tests. -->
<exclude>
<directory suffix="Test.php">./</directory>
<directory suffix="TestBase.php">./</directory>
</exclude>
</whitelist>
</filter>
<!-- Logging for coverage reports. -->
<logging>
<log type="coverage-clover" target="./build/logs/clover.xml"/>
<log type="coverage-html" target="./build/logs/coverage-html"/>
</logging>
</include>
<exclude>
<directory>./modules/*/src/Tests</directory>
<directory>./modules/*/tests</directory>
<directory>./modules/*/*/src/Tests</directory>
<directory>./modules/*/*/tests</directory>
<directory suffix=".api.php">./modules/**</directory>
</exclude>
</coverage>
</phpunit>
12 changes: 12 additions & 0 deletions 10/10.3/tests/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: '/'
Expand Down Expand Up @@ -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
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f7c72ea

Please sign in to comment.