Skip to content

Commit

Permalink
#1462: Separate out MySQL8 tests from drupal10 default test.
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec committed Feb 24, 2023
1 parent 66fa05a commit f0cdef9
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-drupal-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- examples/drupal8
- examples/drupal9
- examples/drupal10
- examples/drupal10-mysql8
lando-versions:
- edge
os:
Expand Down
1 change: 1 addition & 0 deletions examples/drupal10-mysql8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drupal10
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lando-drupal10
name: lando-drupal10-mysql8
recipe: drupal10
config:
webroot: .
Expand Down
82 changes: 82 additions & 0 deletions examples/drupal10-mysql8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Drupal 10 Example
================

This example exists primarily to test the following documentation:

* [Drupal 10 Recipe](https://docs.lando.dev/config/drupal10.html)

Start up tests
--------------

Run the following commands to get up and running with this example.

```bash
# Should poweroff
lando poweroff

# Create latest drupal10 project via composer
mkdir -p mysql8 && cp .lando.yml mysql8/.lando.yml && cd mysql8
lando composer create-project drupal/recommended-project:10.0.x-dev@dev tmp && cp -r tmp/. . && rm -rf tmp

# Should start up successfully
cd mysql8
echo -e "\nplugins:\n \"@lando/drupal/\": ./../../" >> .lando.yml
lando start
```

Verification commands
---------------------

Run the following commands to validate things are rolling as they should.

```bash
# Should return the drupal installation page by default
cd mysql8
lando ssh -s appserver -c "curl -L localhost" | grep "Drupal 10"

# Should use 8.1 as the default php version
cd mysql8
lando php -v | grep "PHP 8.1"

# Should be running apache 2.4 by default
cd mysql8
lando ssh -s appserver -c "apachectl -V | grep 2.4"
lando ssh -s appserver -c "curl -IL localhost" | grep Server | grep 2.4

# Should be running mysql 8.0.x
cd mysql8
lando mysql -V | grep 8.0

# Should be running sqlite 3.34 by default
cd mysql8
lando php -r "print_r(SQLite3::version());" | grep versionString | grep 3.34

# Should not enable xdebug by default
cd mysql8
lando php -m | grep xdebug || echo $? | grep 1

# Should use the default database connection info
cd mysql8
lando mysql -udrupal10 -pdrupal10 drupal10 -e quit

# Should use site-local drush if installed
cd mysql8
lando composer require drush/drush
lando ssh -c "which drush" | grep "/app/vendor/bin/drush"

# Should be able to install drupal
cd mysql8
lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y
```

Destroy tests
-------------

Run the following commands to trash this app like nothing ever happened.

```bash
# Should be destroyed with success
cd mysql8
lando destroy -y
lando poweroff
```
7 changes: 0 additions & 7 deletions examples/drupal10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ lando ssh -c "which drush" | grep "/app/vendor/bin/drush"
# Should be able to install drupal
cd drupal10
lando drush si --db-url=mysql://drupal10:drupal10@database/drupal10 -y

# Should be able to use MySQL 8.x
cd drupal10
pwd
cp ../mysql8.lando.yml .lando.yml
lando rebuild -y
lando mysql -V | grep 8.0
```

Destroy tests
Expand Down
1 change: 0 additions & 1 deletion recipes/drupal10/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module.exports = {
} else if (_.get(options, 'database') === 'postgres') {
options.database = 'postgres:12';
}

// Send it downstream
super(id, options);
};
Expand Down

0 comments on commit f0cdef9

Please sign in to comment.