From 6275d37fbed22f6ecf5705da456e8340f8d0d73f Mon Sep 17 00:00:00 2001 From: Matias Vessuri <95372759+mvessuri@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:39:44 -0300 Subject: [PATCH 1/2] Upgrade Node.js from 16 to 18 to meet Drupal 10.1.x requirements --- .lando.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lando.yml b/.lando.yml index fcad8ca..171b22f 100644 --- a/.lando.yml +++ b/.lando.yml @@ -9,7 +9,7 @@ services: build_as_root: # Note that you will want to use the script for the major version of node you want to install # See: https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions - - curl -sL https://deb.nodesource.com/setup_16.x | bash - + - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - - apt-get install -y nodejs - npm install --global yarn run: From c0fdaf985760aeaa368c003cb6566d4366562fa6 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Mon, 16 Sep 2024 15:22:04 +0300 Subject: [PATCH 2/2] Initial Drupal 11 support. --- .lando.yml | 14 +++-- README.md | 8 +-- config/drupal-branch.php | 2 +- phpunit.xml | 119 ++++++++++++++++++++++++++++----------- scripts/rebuild.sh | 2 +- scripts/site-install.sh | 2 +- 6 files changed, 101 insertions(+), 46 deletions(-) diff --git a/.lando.yml b/.lando.yml index 171b22f..7fffa2a 100644 --- a/.lando.yml +++ b/.lando.yml @@ -1,5 +1,5 @@ name: drupal-contributions -recipe: drupal10 +recipe: drupal11 config: webroot: web @@ -9,22 +9,24 @@ services: build_as_root: # Note that you will want to use the script for the major version of node you want to install # See: https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions - - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - + - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - - apt-get install -y nodejs - - npm install --global yarn + - corepack enable run: - cd /app/web && composer require drush/drush && composer install - mkdir -p private/browsertest_output - - yarn install --non-interactive --cwd /app/web/core + - yarn --cwd /app/web/core install overrides: environment: + COREPACK_ENABLE_DOWNLOAD_PROMPT: 0 SIMPLETEST_BASE_URL: "http://drupal-contributions.lndo.site/" - SIMPLETEST_DB: "sqlite://localhost/tmp/db.sqlite" + #SIMPLETEST_DB: "sqlite://localhost/tmp/db.sqlite" + SIMPLETEST_DB: 'mysql://drupal11:drupal11@database:3306/drupal11' BROWSERTEST_OUTPUT_DIRECTORY: '/app/web/sites/simpletest/browser_output' BROWSERTEST_OUTPUT_BASE_URL: 'http://drupal-contributions.lndo.site' MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless"]}}, "http://chrome:9515"]' # Nightwatch DRUPAL_TEST_BASE_URL: 'http://drupal-contributions.lndo.site' - DRUPAL_TEST_DB_URL: 'mysql://drupal10:drupal10@database:3306/drupal10' + DRUPAL_TEST_DB_URL: 'mysql://drupal11:drupal11@database:3306/drupal11' DRUPAL_TEST_WEBDRIVER_HOSTNAME: chrome DRUPAL_TEST_WEBDRIVER_PORT: 9515 DRUPAL_TEST_CHROMEDRIVER_AUTOSTART: 'false' diff --git a/README.md b/README.md index 3647f89..9955599 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Video presentation: [SFDUG - June 25 - Lando for Contrib / LLC, Corporation or S Let's step through how to spin up your contribution workflow. First clone down this repo: ``` -git clone -b 10.x git@github.com:lando/drupal-contributions.git +git clone -b 11.x git@github.com:lando/drupal-contributions.git cd drupal-contributions ``` @@ -54,7 +54,7 @@ Next `rebuild` the `drupal-contributions` app: lando rebuild -y ``` -This will pull in the drupal source code from the latest `10.x-dev` branch, run `composer install` to get dependencies, install Drupal, and provide us with a one time login link (`uli`). You can update the version in the `/config/drupal-branch.php` file. +This will pull in the drupal source code from the latest `11.x-dev` branch, run `composer install` to get dependencies, install Drupal, and provide us with a one time login link (`uli`). You can update the version in the `/config/drupal-branch.php` file. After `rebuild` completes you should see something similar to this: @@ -83,7 +83,7 @@ and the `web` directory should be populated with the Drupal source code. #### Test a Core Patch -Now we are ready to find a Drupal core issue. Search the issue queue for a core `10.x` issue that you want to test. Grab the URL of the latest patch and apply it to our `drupal-contributions` environment. +Now we are ready to find a Drupal core issue. Search the issue queue for a core `11.x` issue that you want to test. Grab the URL of the latest patch and apply it to our `drupal-contributions` environment. For example, if you choose the issue [Create new "Views Responsive Grid" format for Views Core](https://www.drupal.org/project/drupal/issues/3151553), the latest corresponding patch (as of 23 April 2022) is https://git.drupalcode.org/project/drupal/-/merge_requests/1585.diff ("plain diff" link). To apply this patch: @@ -287,7 +287,7 @@ lando nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js ## La Fin -Once you have the latest `10.x-dev` branch you can keep it and sync it periodically and `lando start`'s will keep that around. If you want to totally start fresh: +Once you have the latest `11.x-dev` branch you can keep it and sync it periodically and `lando start`'s will keep that around. If you want to totally start fresh: ``` # destroys drupal-contributions app and removes /web diff --git a/config/drupal-branch.php b/config/drupal-branch.php index 6a53c9c..a6d08f8 100644 --- a/config/drupal-branch.php +++ b/config/drupal-branch.php @@ -4,4 +4,4 @@ * @file * The branch of Drupal core targeted by the current issue. */ -$drupalBranch = '10.1.x'; +$drupalBranch = '11.x'; diff --git a/phpunit.xml b/phpunit.xml index c7a78cd..39c7064 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,57 +1,110 @@ - - - - ./web/core/includes - ./web/core/lib - ./web/core/modules - ./web/modules - ./web/sites - - - ./web/core/modules/*/src/Tests - ./web/core/modules/*/tests - ./web/modules/*/src/Tests - ./web/modules/*/tests - ./web/modules/*/*/src/Tests - ./web/modules/*/*/tests - - + - - + + + + + + + + + - ./web/core/tests/TestSuites/UnitTestSuite.php + ./web/core/tests/Drupal/Tests + ./web/core/modules/**/tests/src/Unit + ./web/core/profiles/**/tests/src/Unit + ./web/core/themes/**/tests/src/Unit + ./web/modules/**/tests/src/Unit + ./web/profiles/**/tests/src/Unit + ./web/themes/**/tests/src/Unit - ./web/core/tests/TestSuites/KernelTestSuite.php + ./web/core/tests/Drupal/KernelTests + ./web/core/modules/**/tests/src/Kernel + ./web/core/recipes/*/tests/src/Kernel + ./web/core/profiles/**/tests/src/Kernel + ./web/core/themes/**/tests/src/Kernel + ./web/modules/**/tests/src/Kernel + ./web/profiles/**/tests/src/Kernel + ./web/themes/**/tests/src/Kernel - ./web/core/tests/TestSuites/FunctionalTestSuite.php + ./web/core/tests/Drupal/FunctionalTests + ./web/core/modules/**/tests/src/Functional + ./web/core/profiles/**/tests/src/Functional + ./web/core/recipes/*/tests/src/Functional + ./web/core/themes/**/tests/src/Functional + ./web/modules/**/tests/src/Functional + ./web/profiles/**/tests/src/Functional + ./web/themes/**/tests/src/Functional - ./web/core/tests/TestSuites/FunctionalJavascriptTestSuite.php + ./web/core/tests/Drupal/FunctionalJavascriptTests + ./web/core/modules/**/tests/src/FunctionalJavascript + ./web/core/recipes/*/tests/src/FunctionalJavascript + ./web/core/profiles/**/tests/src/FunctionalJavascript + ./web/core/themes/**/tests/src/FunctionalJavascript + ./web/modules/**/tests/src/FunctionalJavascript + ./web/profiles/**/tests/src/FunctionalJavascript + ./web/themes/**/tests/src/FunctionalJavascript - ./web/core//tests/TestSuites/BuildTestSuite.php + ./web/core/tests/Drupal/BuildTests - - - - - - - - + + + + ./web/core/includes + ./web/core/lib + ./web/core/modules + ./web/modules + ./web/sites + + + ./web/core/modules/*/src/Tests + ./web/core/modules/*/tests + ./web/modules/*/src/Tests + ./web/modules/*/tests + ./web/modules/*/*/src/Tests + ./web/modules/*/*/tests + ./web/core/lib/** + ./web/core/modules/** + ./web/modules/** + + diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh index d396a7b..3d58378 100755 --- a/scripts/rebuild.sh +++ b/scripts/rebuild.sh @@ -1,6 +1,6 @@ #!/bin/sh -/app/web/vendor/drush/drush/drush --root=/app/web si --db-url=mysql://drupal10:drupal10@database/drupal10 -y +/app/web/vendor/drush/drush/drush --root=/app/web si --db-url=mysql://drupal11:drupal11@database/drupal11 -y mkdir -p -m 777 /app/web/sites/simpletest/browser_output find /app/web/sites/default -type d -exec chmod 777 '{}' \; /app/web/vendor/drush/drush/drush --root=/app/web --uri=https://drupal-contributions.lndo.site uli diff --git a/scripts/site-install.sh b/scripts/site-install.sh index 6383aee..93356b9 100755 --- a/scripts/site-install.sh +++ b/scripts/site-install.sh @@ -1,5 +1,5 @@ #!/bin/sh -/app/web/vendor/drush/drush/drush --root=/app/web si --db-url=mysql://drupal10:drupal10@database/drupal10 -y $1 +/app/web/vendor/drush/drush/drush --root=/app/web si --db-url=mysql://drupal11:drupal11@database/drupal11 -y $1 find /app/web/sites/default -type d -exec chmod 777 '{}' \; /app/web/vendor/drush/drush/drush --root=/app/web --uri=https://drupal-contributions.lndo.site uli