Skip to content

Commit

Permalink
Add test case for mysqldump deprecation (#54)
Browse files Browse the repository at this point in the history
* Add test case for mysqldump deprecation

This is a test for a proposed change to lando/core, to address
#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 <alec+git@lando.dev>
  • Loading branch information
christopher-b and reynoldsalec committed Jun 11, 2024
1 parent 223a531 commit e1ee8c2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-mariadb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- examples/11.2
- examples/11.3
- examples/custom
- examples/tooling
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
22 changes: 22 additions & 0 deletions examples/tooling/.lando.yml
Original file line number Diff line number Diff line change
@@ -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": ../..
38 changes: 38 additions & 0 deletions examples/tooling/README.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit e1ee8c2

Please sign in to comment.