diff --git a/.github/workflows/pr-backdrop-tests.yml b/.github/workflows/pr-backdrop-tests.yml index 24ed37c..a5d5c13 100644 --- a/.github/workflows/pr-backdrop-tests.yml +++ b/.github/workflows/pr-backdrop-tests.yml @@ -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 diff --git a/examples/backdrop-mysql57/.lando.yml b/examples/backdrop-mysql57/.lando.yml new file mode 100644 index 0000000..088fed1 --- /dev/null +++ b/examples/backdrop-mysql57/.lando.yml @@ -0,0 +1,10 @@ +name: backdrop-mysql57 +recipe: backdrop +config: + php: '8.4' + database: mysql + webroot: web + +# do not remove this +plugins: + "@lando/backdrop": ../.. diff --git a/examples/backdrop-mysql57/README.md b/examples/backdrop-mysql57/README.md new file mode 100644 index 0000000..1fc7fca --- /dev/null +++ b/examples/backdrop-mysql57/README.md @@ -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 +```