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

Final config for use with DDEV v1.23.1, replaces #30, replaces #23 #31

Merged
merged 7 commits into from
May 23, 2024
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ We're in #ddev-for-core-dev on [Drupal Slack](https://www.drupal.org/community/c
```
git clone https://git.drupalcode.org/project/drupal.git drupal
cd drupal
ddev config --project-type=drupal10
ddev config --omit-containers=db --disable-settings-management
ddev start
ddev corepack enable
ddev get justafish/ddev-drupal-core-dev
ddev restart
ddev composer install
Expand Down
2 changes: 1 addition & 1 deletion commands/web/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ if ! command -v phpunit >/dev/null; then
fi
echo "Clearing old webdriver sessions"
curl -f -s http://chrome:4444/status | jq -r '.value.nodes[].slots[].session.sessionId' | while read -r session; do if [ "$session" != "null" ]; then curl -X DELETE "http://chrome:4444/session/$session"; fi; done
phpunit -c core --verbose "$@"
phpunit -c core "$@"
11 changes: 11 additions & 0 deletions config.ddev-drupal-core-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# #ddev-generated
# This file is placed by the justafish/ddev-drupal-core-dev addon.

webimage_extra_packages: ["chromium-driver"]
ddev_version_constraint: '>=v1.23.1'
omit_containers: ["db"]
upload_dirs:
# The install technique tries to remove all of sites/default/files
# but with DDEV + mutagen that isn't possible.
# so just redirect the upload_dirs.
- .ddev/tmp
3 changes: 2 additions & 1 deletion core-dev/phpunit-chrome.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<env name="SIMPLETEST_BASE_URL" value="DRUPAL_CORE_DDEV_URL"/>
<env name="SIMPLETEST_DB" value="mysql://db:db@db/db"/>
<!-- <env name="SIMPLETEST_DB" value="mysql://db:db@db/db"/> -->
<env name="SIMPLETEST_DB" value="sqlite://localhost/sites/default/files/db.sqlite"/>
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/html/test_output"/>
<!-- By default, browser tests will output links that use the base URL set
in SIMPLETEST_BASE_URL. However, if your SIMPLETEST_BASE_URL is an internal
Expand Down
3 changes: 2 additions & 1 deletion core-dev/phpunit-firefox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<env name="SIMPLETEST_BASE_URL" value="DRUPAL_CORE_DDEV_URL"/>
<env name="SIMPLETEST_DB" value="mysql://db:db@db/db"/>
<!-- <env name="SIMPLETEST_DB" value="mysql://db:db@db/db"/> -->
<env name="SIMPLETEST_DB" value="sqlite://localhost/sites/default/files/db.sqlite"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 do we really want this synced with mutagen and the like? What about storing in /tmp, or if it needs to be persistent in /home/<user>/...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review.

This is the traditional place for the sqlite file, Drupal core has used it for years.

On a normal DDEV macOS system, it would not be relavent to mutagen, since it would be bind-mounted with sites/default/files. However, with the current strategy here, ddev drupal believes drupal is installed if sites/default/files exists. But now with drush in #33 we won't have that problem as much.

IMO we should just leave it alone for now since it's the traditional location and in #34 we end up. being able to use mariadb or other traditional database types.

I'll also be doing a followup that uses tmpfs for mounting the mariadb, which is related to your persistence questions.

(Note that /home does not persist by default in a ddev-webserver environment though, but there are other options)

<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/html/test_output"/>
<!-- By default, browser tests will output links that use the base URL set
in SIMPLETEST_BASE_URL. However, if your SIMPLETEST_BASE_URL is an internal
Expand Down
3 changes: 1 addition & 2 deletions install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: ddev-drupal-core-dev

project_files:
- web-build/Dockerfile
- config.ddev-drupal-core-dev.yaml
- docker-compose.core-dev-selenium.yaml
- core-dev/phpunit-firefox.xml
- core-dev/phpunit-chrome.xml
Expand All @@ -26,7 +26,6 @@ post_install_actions:
- cp core-dev/gitignore ../.gitignore
- mkdir -p ../test_output
- chmod +w ../test_output
- ddev exec corepack enable
- cd ../core && ddev yarn

removal_actions:
Expand Down
2 changes: 1 addition & 1 deletion tests/test.bats
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
setup() {
set -eu -o pipefail
export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.."
export TESTDIR=~/tmp/ddev-drupal-core-dev
export TESTDIR=~/tmp/test-ddev-drupal-core-dev
mkdir -p $TESTDIR
export PROJNAME=ddev-drupal-core-dev
export DDEV_NON_INTERACTIVE=true
Expand Down
17 changes: 0 additions & 17 deletions web-build/Dockerfile

This file was deleted.