Skip to content

Commit efa0720

Browse files
committed
test against Drupal 11.2.x
1 parent 69b5f4e commit efa0720

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

config/drupal11/mysql8.cnf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# LANDODRUPALMYSQL8CNF
55

66
[server]
7-
# Basic settings
8-
mysql_native_password=ON
9-
107
# Character sets and SQL mode
118
character_set_server = utf8mb4
129
collation_server = utf8mb4_general_ci
@@ -48,10 +45,14 @@ innodb_adaptive_hash_index = 0
4845
innodb_use_native_aio = 0
4946
innodb_lock_wait_timeout = 127
5047

48+
[mysqld-8.4]
49+
mysql_native_password=ON
50+
5151
[client]
5252
default_character_set=utf8mb4
5353
max_allowed_packet = 64M
5454

5555
[mysqldump]
5656
quick
5757
quote-names
58+
no-tablespaces

examples/drupal11-mysql84/README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Drupal 11 Example
1+
# Drupal 11 with MySQL 8.4 Example
22

3-
This example exists primarily to test the following documentation against mysql 8.4:
3+
This example exists primarily to test the following documentation against MySQL 8.4:
44

55
* [Drupal 11 Recipe](https://docs.lando.dev/plugins/drupal)
66

@@ -35,7 +35,7 @@ cat .lando.yml | grep "composer_version: 2-latest"
3535

3636
# Should be running mysql 8.4.x
3737
cd drupal11
38-
lando mysql -V | tee >(cat 2>&1) | grep 8.4
38+
lando mysql -V | tee >(cat 1>&2) | grep '8.4.'
3939

4040
# Should return the drupal installation page by default
4141
cd drupal11
@@ -47,8 +47,8 @@ lando php -v | grep "PHP 8.3"
4747

4848
# Should be running apache 2.4 by default
4949
cd drupal11
50-
lando exec appserver -- apachectl -V | grep 2.4
51-
lando exec appserver -- curl -IL localhost | grep Server | grep 2.4
50+
lando exec appserver -- apachectl -V | grep '2.4'
51+
lando exec appserver -- curl -IL localhost | grep Server | grep '2.4'
5252

5353
# Should be running sqlite 3.45 by default
5454
cd drupal11
@@ -68,12 +68,12 @@ lando composer --version | cut -d " " -f 3 | head -n 1 | awk -v min=2.7.0 -F. '(
6868

6969
# Should use site-local drush if installed
7070
cd drupal11
71-
lando composer require drush/drush
71+
lando composer require drush/drush --no-interaction
7272
lando exec appserver -- which drush | grep "/app/vendor/bin/drush"
7373

7474
# Should be able to install drupal
7575
cd drupal11
76-
lando drush si --db-url=mysql://drupal11:drupal11@database/drupal11 -y
76+
lando drush site:install --db-url=mysql://drupal11:drupal11@database/drupal11 -y
7777

7878
# Should be able to enable and access jsonapi
7979
cd drupal11
@@ -82,13 +82,37 @@ lando exec appserver -- curl localhost/jsonapi | grep "action--action"
8282

8383
# Should be able to dump the database with drush
8484
cd drupal11
85-
lando drush sql-dump --result-file=drupal11.sql
86-
lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep 1
85+
lando drush sql-dump --result-file=drupal11.sql --extra-dump="--no-tablespaces"
86+
lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2
8787

88-
# Should be able to restore the database with drush
88+
# Should be able to drop and restore the database with drush
8989
cd drupal11
9090
lando drush sql-drop -y
9191
lando drush sql-cli < drupal11.sql
92+
lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2
93+
94+
# Should be able to export the database with Lando
95+
cd drupal11
96+
rm -f drupal11.sql
97+
lando db-export drupal11.sql
98+
99+
# Should be able to import the database with Lando
100+
cd drupal11
101+
lando db-import drupal11.sql.gz
102+
lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2
103+
104+
# Should be able to drop database tables
105+
cd drupal11
106+
lando drush sql-drop -y
107+
108+
# Should be able to pipe in file through appserver
109+
cd drupal11
110+
lando exec appserver -- 'zcat drupal11.sql.gz | mysql -h database -udrupal11 -pdrupal11 drupal11'
111+
lando mysql -udrupal11 -pdrupal11 drupal11 -e "SELECT COUNT(*) FROM users;" | grep -A 2 COUNT | tee >(cat 1>&2) | grep 2
112+
113+
# Should bootstrap Drupal successfully
114+
cd drupal11
115+
lando drush status | grep "Drupal bootstrap" | tee >(cat 1>&2) | grep "Successful"
92116
```
93117

94118
## Destroy tests

examples/drupal11/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ lando poweroff
1414

1515
# Should initialize the latest Drupal 11 codebase
1616
rm -rf drupal11 && mkdir -p drupal11 && cd drupal11
17-
lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-11.0.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal11 --webroot . --name lando-drupal11
17+
cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml
18+
lando init --source remote --remote-url https://ftp.drupal.org/files/projects/drupal-11.2.x-dev.tar.gz --remote-options="--strip-components 1" --recipe drupal11 --webroot . --name lando-drupal11
1819

1920
# Should start up successfully
2021
cd drupal11
21-
cp -f ../../.lando.upstream.yml .lando.upstream.yml && cat .lando.upstream.yml
2222
lando start
2323
```
2424

@@ -27,6 +27,12 @@ lando start
2727
Run the following commands to validate things are rolling as they should.
2828

2929
```bash
30+
# Should include recipe defaults in the landofile
31+
cd drupal11
32+
cat .lando.yml | tee >(cat 1>&2) | grep 'php: "8.3"'
33+
cat .lando.yml | grep "drush: ^13"
34+
cat .lando.yml | grep "composer_version: 2-latest"
35+
3036
# Should return the drupal installation page by default
3137
cd drupal11
3238
lando exec appserver -- curl -L localhost | grep "Drupal 11"
@@ -74,13 +80,7 @@ cd drupal11
7480
lando drush en jsonapi -y
7581
lando exec appserver -- curl localhost/jsonapi | grep "action--action"
7682

77-
# Should have recipe defaults
78-
cd drupal11
79-
cat .lando.yml | tee >(cat 1>&2) | grep 'php: "8.3"'
80-
cat .lando.yml | grep "drush: ^13"
81-
cat .lando.yml | grep "composer_version: 2-latest"
82-
83-
# Should still have webroot
83+
# Should have webroot set in the landofile
8484
cd drupal11
8585
cat .lando.yml | grep "webroot: ."
8686
```

0 commit comments

Comments
 (0)