Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Drupal 11 support #189

Draft
wants to merge 20 commits into
base: 3.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f1ca640
Added Drupal 11 support
stephen-cox Dec 18, 2024
cd20966
fix: allow paratest which is compatible with latest version of phpuni…
millnut Dec 24, 2024
46f4a6a
fix: override fontawesome with dev version
millnut Dec 25, 2024
a2ba10e
fix: update composer installers to fix deprecated warnings
millnut Dec 25, 2024
9e5f82c
fix: add patch to php-htmldiff to fix PHP 8.4 errors in PHPUnit
millnut Dec 25, 2024
085770f
fix: update phpunit config to match drupal core
millnut Dec 25, 2024
ec55d88
fix: update phpunit config to match drupal core
millnut Dec 25, 2024
22395b2
fix: update phpunit config to match drupal core
millnut Dec 25, 2024
2865e44
fix: remove geo entity composer alias now there is a version with D11…
millnut Dec 31, 2024
67be6c8
feat: add separate phpunit file for D11
millnut Jan 10, 2025
fd6eec4
feat: fontawesome now has a D11 release so remove the repo usage
millnut Jan 23, 2025
ac9dc2d
fix: remove patch for caxy/php-htmldiff as latest version now support…
millnut Jan 23, 2025
9c79009
Updated Github workflow to test with Drupal 11
stephen-cox Feb 7, 2025
4aab87a
Tweaks for D11 support
stephen-cox Feb 7, 2025
2cdec57
Adjust Github workflow to workaround dev package install failure
stephen-cox Feb 7, 2025
6050133
fix: only phpcs and phpstan once and for now set to core 10 and PHP 8.4
millnut Feb 8, 2025
dfd40fb
fix: add composer-drupal-lenient for facets_form as no D11 release
millnut Feb 8, 2025
7335bb6
fix: add specific drupal core install as project can be either 10 or …
millnut Feb 10, 2025
f5327ff
fix: add specific drupal core install as project can be either 10 or …
millnut Feb 10, 2025
0bd7b68
fix: add specific drupal core install as project can be either 10 or …
millnut Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 49 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,25 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '3.x'
drupal-version:
- '~10.0'
php-version:
- '8.1'
- '8.2'
- '8.3'
include:
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.2'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.3'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.4'
- localgov-version: '3.x'
drupal-version: '~11.0'
php-version: '8.3'
- localgov-version: '3.x'
drupal-version: '~11.0'
php-version: '8.4'

steps:
- name: Save git branch and git repo names to env if this is not a pull request
Expand Down Expand Up @@ -78,10 +89,17 @@ jobs:
ref: php${{ matrix.php-version }}

- name: Create LocalGov Drupal project
run: composer create-project --stability dev localgovdrupal/localgov-project:${COMPOSER_REF} ./html
run: |
composer create-project --stability dev --no-install localgovdrupal/localgov-project:${COMPOSER_REF} ./html
composer require --working-dir=./html --no-install --with-all-dependencies drupal/core-recommended:${{ matrix.drupal-version }} drupal/core-composer-scaffold:${{ matrix.drupal-version }} drupal/core-project-message:${{ matrix.drupal-version }} drupal/core-dev:${{ matrix.drupal-version }}
composer install --working-dir=./html

- name: Obtain all dev dependencies for LocalGov Drupal
run: jq --raw-output '.packages[] | select(.name | startswith("localgovdrupal/")) | ."require-dev" | values | to_entries[] | @sh "\(.key):\(.value)"' ./html/composer.lock | sort | uniq | xargs composer --working-dir=./html require --dev --no-interaction
run: |
# We haven't aliased dev packages so this fails.
#jq --raw-output '.packages[] | select(.name | startswith("localgovdrupal/")) | ."require-dev" | values | to_entries[] | @sh "\(.key):\(.value)"' ./html/composer.lock | sort | uniq | xargs composer --working-dir=./html require --dev --no-interaction
# Just install the ones we need for now.
composer --working-dir=./html require --dev --no-interaction drupal/geofield_map drupal/group drupal/facets_form

phpcs:
name: Coding standards checks
Expand All @@ -96,7 +114,7 @@ jobs:
drupal-version:
- '~10.0'
php-version:
- '8.3'
- '8.4'

steps:
- name: Cached workspace
Expand Down Expand Up @@ -130,7 +148,7 @@ jobs:
drupal-version:
- '~10.0'
php-version:
- '8.3'
- '8.4'

steps:
- name: Cached workspace
Expand Down Expand Up @@ -158,14 +176,25 @@ jobs:
strategy:
fail-fast: false
matrix:
localgov-version:
- '3.x'
drupal-version:
- '~10.0'
php-version:
- '8.1'
- '8.2'
- '8.3'
include:
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.1'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.2'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.3'
- localgov-version: '3.x'
drupal-version: '~10.0'
php-version: '8.4'
- localgov-version: '3.x'
drupal-version: '~11.0'
php-version: '8.3'
- localgov-version: '3.x'
drupal-version: '~11.0'
php-version: '8.4'

steps:
- name: Clone Drupal container
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore directories generated by Composer
/drush/contrib/
/recipes/
/vendor/
/web/core/
/web/modules/contrib/
Expand Down
6 changes: 3 additions & 3 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: localgov
recipe: drupal10
recipe: drupal11
config:
webroot: web
php: '8.1'
database: mariadb:10.6
php: '8.3'
database: mariadb:10.11
proxy:
mailhog:
- mail.localgov.lndo.site
Expand Down
27 changes: 17 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
}
},
"require": {
"composer/installers": "^1.10",
"composer/installers": "^1.10 || ^2.3",
"cweagans/composer-patches": "^1.6",
"drupal/core-composer-scaffold": "^10.3",
"drupal/core-recommended": "^10.3",
"localgovdrupal/localgov": "^3.0",
"localgovdrupal/localgov_search_solr": "^1.1"
"drupal/core-composer-scaffold": "^10.3 || ^11.0",
"drupal/core-recommended": "^10.3 || ^11.0",
"localgovdrupal/localgov": "dev-feature/3.x/d11-support",
"localgovdrupal/localgov_search_solr": "^1.1",
"mglaman/composer-drupal-lenient": "^1.0"
},
"require-dev": {
"brianium/paratest": "^6.0",
"brianium/paratest": "^6.0 || ^7.3.1",
"drupal/coder": "^8.3",
"drupal/core-dev": "^10.3",
"drupal/core-dev": "^10.3 || ^11.0",
"mglaman/phpstan-drupal": "^1.0",
"phpspec/prophecy-phpunit": "^2",
"phpstan/phpstan": "^1.0",
Expand All @@ -40,11 +41,13 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"mglaman/composer-drupal-lenient": true,
"php-http/discovery": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
"tbachert/spi": true
}
},
"extra": {
Expand Down Expand Up @@ -91,7 +94,11 @@
"drush/Commands/contrib/{$name}": ["type:drupal-drush"],
"web/modules/custom/{$name}": ["type:drupal-custom-module"],
"web/themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"drupal-lenient": {
"allowed-list": [
"drupal/facets_form"
]
}

}
}
64 changes: 64 additions & 0 deletions phpunit.d11.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="web/core/tests/bootstrap.php" colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
cacheResult="false">

<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<env name="SIMPLETEST_BASE_URL" value="http://localgov.lndo.site"/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value="mysql://database:database@database/database"/>
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<!-- 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.
-->
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>
</php>

<extensions>
<!-- Functional tests HTML output logging. -->
<bootstrap class="Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger">
<!-- The directory where the browser output will be stored. If a relative
path is specified, it will be relative to the current working directory
of the process running the PHPUnit CLI. In CI environments, this can be
overridden by the value set for the "BROWSERTEST_OUTPUT_DIRECTORY"
environment variable.
-->
<parameter name="outputDirectory" value="sites/simpletest/browser_output"/>
<!-- By default browser tests print the individual links in the test run
report. To avoid overcrowding the output in CI environments, you can
set the "verbose" parameter or the "BROWSERTEST_OUTPUT_VERBOSE"
environment variable to "false". In GitLabCI, the output is saved
anyway as an artifact that can be browsed or downloaded from Gitlab.
-->
<parameter name="verbose" value="true"/>
</bootstrap>
</extensions>

<testsuites>
<testsuite name="profile">
<directory>web/profiles/contrib/localgov</directory>
</testsuite>
<testsuite name="modules">
<directory>web/modules/contrib/localgov_*</directory>
</testsuite>
<testsuite name="themes">
<directory>./web/themes/contrib/localgov_*</directory>
</testsuite>
</testsuites>

</phpunit>
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
failOnWarning="true"
cacheResult="false"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter">

<php>
Expand Down
Loading