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
1 change: 1 addition & 0 deletions .github/workflows/pr-backdrop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- examples/backdrop-mariadb
- examples/backdrop-mysql8
- examples/backdrop-mysql-client
- examples/backdrop-mysql57
- examples/backdrop-nginx
lando-version:
- 3-edge
Expand Down
10 changes: 10 additions & 0 deletions examples/backdrop-mysql57/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: backdrop-mysql57
recipe: backdrop
config:
php: '8.4'
database: mysql
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing MySQL 5.7 version pin in database config

High Severity

The database config is set to mysql without a version tag, but this test exists specifically to reproduce MySQL 5.7 SSL issues (lando/lando#3833). Other examples in this repo (e.g. backdrop-custom) use database: mysql:5.7 to pin the version. Without the :5.7 suffix, this will spin up the default MySQL version instead of 5.7, meaning the test won't actually validate the SSL connectivity scenario it was created for.

Fix in Cursor Fix in Web

webroot: web

# do not remove this
plugins:
"@lando/backdrop": ../..
75 changes: 75 additions & 0 deletions examples/backdrop-mysql57/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Backdrop MySQL Default Version SSL Test

This example tests that the backdrop recipe with `database: mysql` (no version
specified, using whatever the default is) correctly handles database client
connectivity. This matches the real-world scenario where users just set
`database: mysql` without pinning a version.

See: https://github.com/lando/lando/issues/3833

## Start up tests

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

```bash
# Should download and extract Backdrop
lando poweroff
rm -rf web && mkdir -p web
curl -fsSL https://github.com/backdrop/backdrop/releases/download/1.33.1/backdrop.zip -o /tmp/backdrop.zip
unzip -q /tmp/backdrop.zip -d web
mv web/backdrop/* web/backdrop/.* web/ 2>/dev/null || true
rmdir web/backdrop 2>/dev/null || true
```

```bash
# Should start up successfully
lando start
```

```bash
# Should install Backdrop with bee
cd web && chmod +x core/scripts/*
lando bee site-install --db-name=backdrop --db-user=backdrop --db-pass=backdrop --db-host=database --username=admin --password=admin --email=test@lando.dev --site-name="MySQL Default Test" --auto
```

## Verification commands

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

```bash
# Should auto-detect MySQL and install the MySQL client (not MariaDB)
lando exec appserver -- mysql --version | grep -qiv "MariaDB"
```

```bash
# Should be able to connect to MySQL 5.7 without SSL errors
lando mysql backdrop -e "SELECT 1"
```

```bash
# Should be able to run mysql from appserver without SSL errors
lando exec appserver -- mysql -h database -u backdrop -pbackdrop backdrop -e "SELECT 1"
```

```bash
# Should be able to export with bee without SSL errors
cd web
lando bee db-export /tmp/bee-export.sql
lando exec appserver -- bash -c "zcat /tmp/bee-export.sql.gz | head -5" | grep -i "dump"
```

```bash
# Should be able to export with db-export without SSL errors
lando db-export --stdout > /tmp/lando-export.sql
head -5 /tmp/lando-export.sql | grep -i "dump"
```

## Destroy tests

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

```bash
# Should be destroyed with success
lando destroy -y
lando poweroff
```
Loading