From e1ee8c2fad6c01667f5fb31278aa686eb6321ce2 Mon Sep 17 00:00:00 2001 From: christopher-b Date: Tue, 11 Jun 2024 18:56:54 -0400 Subject: [PATCH] Add test case for mysqldump deprecation (#54) * Add test case for mysqldump deprecation This is a test for a proposed change to lando/core, to address lando/mariadb#47. * Improve mysqldump deprecation test Make better use of `grep` in the test, and direct output of dump command to STDOUT so the test doesn't generate export files. * #47: Test a db-export type tooling command. * #47: Make sure we actually add the test. * #47: Better name for the test. * Make checklinks happy. * Make checklinks happy. --------- Co-authored-by: Alec Reynolds --- .github/workflows/pr-mariadb-tests.yml | 1 + docs/config.md | 4 +-- docs/index.md | 4 +-- examples/tooling/.lando.yml | 22 +++++++++++++++ examples/tooling/README.md | 38 ++++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 examples/tooling/.lando.yml create mode 100644 examples/tooling/README.md diff --git a/.github/workflows/pr-mariadb-tests.yml b/.github/workflows/pr-mariadb-tests.yml index a36060b..8a17ac2 100644 --- a/.github/workflows/pr-mariadb-tests.yml +++ b/.github/workflows/pr-mariadb-tests.yml @@ -34,6 +34,7 @@ jobs: - examples/11.2 - examples/11.3 - examples/custom + - examples/tooling steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/docs/config.md b/docs/config.md index 5b8ce6f..fd9baa1 100644 --- a/docs/config.md +++ b/docs/config.md @@ -5,9 +5,9 @@ description: Learn how to configure the Lando MariaDB service. # Configuration -Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/core/v3/lando-service.html) to get a good handle on how the magicks work. +Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/core/v3/services/lando.html) to get a good handle on how the magicks work. -Also note that options, in addition to the [build steps](https://docs.lando.dev/core/v3/lando-service.html#build-steps) and [overrides](https://docs.lando.dev/core/v3/lando-service.html#overrides) that are available to every service, are shown below: +Also note that options, in addition to the [build steps](https://docs.lando.dev/core/v3/services/lando.html#build-steps) and [overrides](https://docs.lando.dev/core/v3/services/lando.html#overrides) that are available to every service, are shown below: ::: warning Be careful when switching database type, version or credentials! You should be careful switching database `type`, `version` or `creds`. diff --git a/docs/index.md b/docs/index.md index 3a633eb..18a761e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ next: ./config.html [MariaDB](https://mariadb.org/) is a very common database server which is *EXTREMELY* similar to MySQL but has a guarantee of being open source. -You can easily add it to your Lando app by adding an entry to the [services](https://docs.lando.dev/core/v3/lando-service.html) top-level config in your [Landofile](https://docs.lando.dev/core/v3). +You can easily add it to your Lando app by adding an entry to the [services](https://docs.lando.dev/core/v3/services/lando.html) top-level config in your [Landofile](https://docs.lando.dev/core/v3). ```yaml services: @@ -27,7 +27,7 @@ services: * [10.5](https://hub.docker.com/r/bitnami/mariadb/tags?name=10.5.) * [10.4](https://hub.docker.com/r/bitnami/mariadb/tags?name=10.4.) * **[10.3](https://hub.docker.com/r/bitnami/mariadb/tags?name=10.3.)** **(default)** -* [custom](https://docs.lando.dev/core/v3/lando-service.html#overrides) +* [custom](https://docs.lando.dev/core/v3/services/lando.html#overrides) ## Legacy versions diff --git a/examples/tooling/.lando.yml b/examples/tooling/.lando.yml new file mode 100644 index 0000000..7e1d33f --- /dev/null +++ b/examples/tooling/.lando.yml @@ -0,0 +1,22 @@ +name: lando-mariadb-tooling +services: + database: + type: mariadb:11.3 +tooling: + 'db-export-test [file]': + service: :host + cmd: '/helpers/sql-export.sh' + user: 'root' + options: + host: + description: The database service to use + default: database + alias: + - h + stdout: + description: Dump database to stdout + +# This is important because it lets lando know to test against the plugin in this repo +# DO NOT REMOVE THIS! +plugins: + "@lando/mariadb": ../.. diff --git a/examples/tooling/README.md b/examples/tooling/README.md new file mode 100644 index 0000000..cc9b196 --- /dev/null +++ b/examples/tooling/README.md @@ -0,0 +1,38 @@ +MariaDB Tooling Example +======================= + +This example exists primarily to test the following documentation: + +* [MariaDB Service](https://docs.devwithlando.io/tutorials/mariadb.html) + +Start up tests +-------------- + +Run the following commands to get up and running with this example. + +```bash +# Should start up successfully +lando poweroff +lando start +``` + +Verification commands +--------------------- + +Run the following commands to validate things are rolling as they should. + +```bash +# Should not see deprecation warning on db-export +lando db-export-test --stdout | grep -vz "Deprecated" +``` + +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 +```