|
1 |
| -# ddev-core-dev |
2 |
| - |
3 |
| -This is a DDEV addon for doing Drupal core development. |
4 |
| - |
5 |
| -We're in #ddev-for-core-dev on [Drupal Slack](https://www.drupal.org/community/contributor-guide/reference-information/talk/tools/slack) (but please try and keep work and feature requests in Issues where it's visible to all 🙏) |
6 |
| - |
7 |
| -``` |
8 |
| -git clone https://git.drupalcode.org/project/drupal.git drupal |
9 |
| -cd drupal |
10 |
| -ddev config --omit-containers=db --disable-settings-management |
11 |
| -ddev start |
12 |
| -ddev get justafish/ddev-drupal-core-dev |
13 |
| -ddev restart |
14 |
| -ddev composer install |
15 |
| -
|
16 |
| -# See included commands |
17 |
| -ddev drupal list |
18 |
| -
|
19 |
| -# Install drupal |
20 |
| -ddev drupal install |
21 |
| -
|
22 |
| -# Run PHPUnit tests |
23 |
| -ddev phpunit core/modules/sdc |
24 |
| -
|
25 |
| -# Run Nightwatch tests (currently only runs on Chrome) |
26 |
| -ddev nightwatch --tag core |
27 |
| -``` |
28 |
| - |
29 |
| -## Nightwatch Examples |
30 |
| - |
31 |
| -You can watch Nightwatch running in real time at https://drupal.ddev.site:7900 |
32 |
| -for Chrome and https://drupal.ddev.site:7901 for Firefox. The password is |
33 |
| -"secret". YMMV using Firefox as core tests don't currently run on it. |
34 |
| - |
35 |
| -Only core tests |
36 |
| -``` |
37 |
| -ddev nightwatch --tag core |
38 |
| -``` |
39 |
| - |
40 |
| -Skip running core tests |
41 |
| -``` |
42 |
| -ddev nightwatch --skiptags core |
43 |
| -``` |
44 |
| - |
45 |
| -Run a single test |
46 |
| -``` |
47 |
| -ddev nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js |
48 |
| -``` |
49 |
| - |
50 |
| -a11y tests for both the admin and default themes |
51 |
| -``` |
52 |
| -ddev nightwatch --tag a11y |
53 |
| -``` |
54 |
| - |
55 |
| -a11y tests for the admin theme only |
56 |
| -``` |
57 |
| -ddev nightwatch --tag a11y:admin |
58 |
| -``` |
59 |
| - |
60 |
| -a11y tests for the default theme only |
61 |
| -``` |
62 |
| -ddev nightwatch --tag a11y:default |
63 |
| -``` |
64 |
| - |
65 |
| -a11y test for a custom theme used as the default theme |
66 |
| -``` |
67 |
| -ddev nightwatch --tag a11y:default --defaultTheme bartik |
68 |
| -``` |
69 |
| - |
70 |
| -a11y test for a custom admin theme |
71 |
| -``` |
72 |
| -ddev nightwatch --tag a11y:admin --adminTheme seven |
73 |
| -``` |
| 1 | +# ddev-core-dev |
| 2 | + |
| 3 | +This is a DDEV addon for doing Drupal core development. |
| 4 | + |
| 5 | +We're in #ddev-for-core-dev on [Drupal Slack](https://www.drupal.org/community/contributor-guide/reference-information/talk/tools/slack) (but please try and keep work and feature requests in Issues where it's visible to all 🙏) |
| 6 | + |
| 7 | +`ddev drush` is fully supported, along with using or testing MariaDB, MySQL, and PostgreSQL databases (and Sqlite3) |
| 8 | + |
| 9 | + |
| 10 | +``` |
| 11 | +git clone https://git.drupalcode.org/project/drupal.git drupal |
| 12 | +cd drupal |
| 13 | +ddev config --project-type=drupal |
| 14 | +ddev get justafish/ddev-drupal-core-dev |
| 15 | +ddev restart |
| 16 | +ddev composer install |
| 17 | +ddev config --update |
| 18 | +
|
| 19 | +
|
| 20 | +# Install drupal |
| 21 | +ddev drush si -y --account-pass==admin |
| 22 | +
|
| 23 | +# Run PHPUnit tests |
| 24 | +ddev phpunit core/modules/sdc |
| 25 | +
|
| 26 | +# Run Nightwatch tests (currently only runs on Chrome) |
| 27 | +ddev nightwatch --tag core |
| 28 | +``` |
| 29 | + |
| 30 | +## Using various database types |
| 31 | + |
| 32 | +By default, the DDEV default database type is used (MariaDB). |
| 33 | + |
| 34 | +To use another supported database type, |
| 35 | +`ddev delete -Oy` and `ddev config --database=mysql:8.0` or `ddev config --database=postgres:16` for example. |
| 36 | + |
| 37 | +To use Sqlite, |
| 38 | +``` |
| 39 | +ddev stop |
| 40 | +ddev config --disable-settings-management --omit-containers=db |
| 41 | +rm -rf web/sites/default/settings*.php web/sites/default/files |
| 42 | +ddev start |
| 43 | +ddev drupal install |
| 44 | +``` |
| 45 | + |
| 46 | +## Nightwatch Examples |
| 47 | + |
| 48 | +You can watch Nightwatch running in real time at https://drupal.ddev.site:7900 |
| 49 | +for Chrome and https://drupal.ddev.site:7901 for Firefox. The password is |
| 50 | +"secret". YMMV using Firefox as core tests don't currently run on it. |
| 51 | + |
| 52 | +Only core tests |
| 53 | +``` |
| 54 | +ddev nightwatch --tag core |
| 55 | +``` |
| 56 | + |
| 57 | +Skip running core tests |
| 58 | +``` |
| 59 | +ddev nightwatch --skiptags core |
| 60 | +``` |
| 61 | + |
| 62 | +Run a single test |
| 63 | +``` |
| 64 | +ddev nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js |
| 65 | +``` |
| 66 | + |
| 67 | +a11y tests for both the admin and default themes |
| 68 | +``` |
| 69 | +ddev nightwatch --tag a11y |
| 70 | +``` |
| 71 | + |
| 72 | +a11y tests for the admin theme only |
| 73 | +``` |
| 74 | +ddev nightwatch --tag a11y:admin |
| 75 | +``` |
| 76 | + |
| 77 | +a11y tests for the default theme only |
| 78 | +``` |
| 79 | +ddev nightwatch --tag a11y:default |
| 80 | +``` |
| 81 | + |
| 82 | +a11y test for a custom theme used as the default theme |
| 83 | +``` |
| 84 | +ddev nightwatch --tag a11y:default --defaultTheme bartik |
| 85 | +``` |
| 86 | + |
| 87 | +a11y test for a custom admin theme |
| 88 | +``` |
| 89 | +ddev nightwatch --tag a11y:admin --adminTheme seven |
| 90 | +``` |
0 commit comments