- Install DDEV (if not already installed): https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/
- Ensure that you have a ssh key setup with Drupal.
- Install
joachim-n/drupal-core-development-project
:
composer create-project -n joachim-n/drupal-core-development-project drupal-core-dev && cd drupal-core-dev
- Add DDEV to the project:
ddev config --project-type=drupal10 --docroot=web
- Install
ddev/ddev-selenium-standalone-chrome
:
ddev get ddev/ddev-selenium-standalone-chrome
- Navigate to the drupal repo and get your bearings. Git status should indicate that you have head branch (currently
11.x
) checked out
cd repos/drupal && git status
- Open the issue you want to work on. For this, I'll use https://www.drupal.org/project/drupal/issues/3208766
- If there isn't already an issue fork, you may need to create one
- If there isn't already an MR, you don't need to create one until you are ready for feedback or core's CI to run
- Click "Show commands" next to the issue fork
- Copy/paste the commands under "Add & fetch this issue fork’s repository" into your terminal and run them
- Find the issue fork branch you want to work on and copy/paste the command under "Check out this branch" into your terminal and run it
- At this point you should be ready to write code, spin up a Drupal site for manual testing, or run automated tests
- Pull changes
git stash -m "3208766 Something something." && git pull --rebase && git stash apply
- If your
git stash apply
command didn't apply cleanly, you may need to resolve conflicts. - Commit and push your changes
git add . && git commit -m "Updated the something something so that is now does something something." && git push
- Note that the Drupal core CI runs every time you push to it and the process takes ~40-60 minutes and uses up resources that the Drupal Association has to pay for, so try to be mindful about how often you are pushing. You can commit often and push when you are ready to see what happens with tests or get feedback from the community.
ddev exec -d /var/www/html/web "../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist ./core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php"
From: https://github.com/ddev/ddev-selenium-standalone-chrome#use
- I recommend the DDEV integration plugin.
- Settings > Directories
- Click caret next to
web
folder to expand - Click
core
folder to select - Next to "Mark as:" click "Excluded
- Apply
- It helps to turn on xdebug and trigger it to run first so it will register a server
- When running FunctionalJavascript tests, a server instance is created and runs at
http://web
. It's helpful to also trigger Xdebug to run during a test to also register that as a server - PHP > Servers
- For each server you have registered, navigate to
repos/drupal
underProject files
. Add/var/www/html/web
under "Absolute path on the server". Click somewhere else to get "Apply" to be available and then click "Apply"