Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .ddev/commands/web/nightwatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

## Description: Run Nightwatch
## Usage: nightwatch [flags] [args]
## Example: "ddev nightwatch" or "ddev nightwatch --tag core"

# Installs dependencies if not already run.
if [ ! -d /var/www/html/web/core/node_modules ]; then
yarn --cwd /var/www/html/web/core install

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mradcliffe I think it would be better if yarn install runs during 'Prebuild', no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I thought maybe it would be too much to add yarn install during the prebuild, and only do it as needed, but I thik you're right, and it would help setup a front-end contributor to run es6 transformation and linting tasks. +1

fi

yarn --cwd /var/www/html/web/core test:nightwatch $@

15 changes: 15 additions & 0 deletions .ddev/commands/web/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

## Description: Run PHPUnit
## Usage: phpunit [flags] [args]
## Example: "ddev phpunit --group big_pipe" or "ddev phpunit core/modules/action"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good place in a ddev command to add troubleshooting steps when running ddev COMMAND --help?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs at https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/,

Description, Usage, and Example are what you get.

For example, ddev help yarn:

$ ddev help yarn
Run yarn inside the web container in the root of the project (Use --cwd for another directory) (global shell host container command)

Usage:
  ddev yarn [flags] [args]

Examples:
  "ddev yarn install" or "ddev yarn add learna" or "ddev yarn --cwd web/core add learna"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess troubleshooting steps would have to go in Description?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the description be multi-line?


mkdir -p /var/www/html/web/sites/simpletest/browser_output
Comment thread
mradcliffe marked this conversation as resolved.
Resolved

cd web

BROWSERTEST_OUTPUT_DIRECTORY=/var/www/html/web/sites/simpletest/browser_output \
BROWSERTEST_OUTPUT_BASE_URL=http://localhost:8080 \
SIMPLETEST_DB="mysql://db:db@db/db" \
SIMPLETEST_BASE_URL="http://localhost" \
php ../vendor/bin/phpunit -c core/phpunit.xml.dist $@
32 changes: 32 additions & 0 deletions .ddev/docker-compose.testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# Adds Chromedriver and Drupal PHPUnit test environment variables for running tests.
version: '3.6'
services:
chromedriver:
image: drupalci/chromedriver:production
container_name: ddev-${DDEV_SITENAME}-chromedriver
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT

web:
links:
- chromedriver:$DDEV_HOSTNAME
environment:
# PHPUnit
SYMFONY_DEPRECATIONS_HELPER: weak
SIMPLETEST_DB: mysql://db:db@db:3306/db
SIMPLETEST_BASE_URL: http://localhost
BROWSERTEST_OUTPUT_DIRECTORY: /var/www/html/private/browsertest_output
BROWSERTEST_OUTPUT_BASE_URL: $DDEV_PRIMARY_URL
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://chromedriver:9515"]'

# Nightwatch
DRUPAL_TEST_BASE_URL: http://web
DRUPAL_TEST_DB_URL: mysql://db:db@db:3306/db
DRUPAL_TEST_WEBDRIVER_HOSTNAME: chromedriver
DRUPAL_TEST_WEBDRIVER_PORT: 9515
DRUPAL_TEST_CHROMEDRIVER_AUTOSTART: 'false'
DRUPAL_TEST_WEBDRIVER_CHROME_ARGS: "--disable-gpu --headless --no-sandbox"
DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch
DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Drupal
web/
vendor/
/web/
/vendor/
composer.json
composer.lock
.editorconfig
Expand Down
3 changes: 2 additions & 1 deletion .gitpod/drupal/drupalpod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ GITMODULESEND
ddev composer require --no-update \
"drupal/core-composer-scaffold:""$DP_CORE_VERSION" \
"drupal/core-project-message:""$DP_CORE_VERSION" \
"drupal/core-recommended:""$DP_CORE_VERSION"
"drupal/core-recommended:""$DP_CORE_VERSION" \
"drupal/core-dev:""$DP_CORE_VERSION"
fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"composer/installers": "^1.9",
"drupal/core-composer-scaffold": "^9.2",
"drupal/core-project-message": "^9.2",
"drupal/core-recommended": "^9.2"
"drupal/core-recommended": "^9.2",
"drupal/core-dev": "^9.2"
},
"conflict": {
"drupal/drupal": "*"
Expand Down Expand Up @@ -85,4 +86,4 @@
]
}
}
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ No computer is needed because it is all running in the cloud.

* Install additional packages - `ddev composer`
* Run Drush commands - `ddev drush <command>`
* Run tests
* Nightwatch - `ddev nightwatch <arguments>`
* PHPUnit - `ddev phpunit <arguments>`
* IDE in a browser
* VScode (default)
* PHPStorm - run `phpstorm`
Expand Down
6 changes: 6 additions & 0 deletions src/vscode-extension/drupalpod-ext/src/help-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ body {
<li>Manually test an issue</li>
<li>Write a patch or contribute to an issue fork</li>
<li>Write an automated test</li>
<li>Run automated tests:
<ul>
<li>Nightwatch: <code>ddev nightwatch</code></li>
<li>PHPUnit: <code>ddev phpunit</code></li>
</ul>
</li>
</ul>
</li>
<li>Find your <a href="https://www.drupal.org/community/contributor-guide/find-your-role">role</a> or <a href="https://www.drupal.org/community/contributor-guide/use-or-improve-your-skills">skill</a> to learn more about how to contribute, or ask if anyone needs some help on an issue in #contribute.</li>
Expand Down