Skip to content

Commit

Permalink
cache tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Jul 23, 2024
1 parent 28b7220 commit 28d7df1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
leia-test:
- badname
- build
# - cache
- cache
# - certs
- config
- debug
Expand Down
2 changes: 1 addition & 1 deletion examples/cache/.lando.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: lando-version
name: lando-cache
compose:
- compose.yml
services:
Expand Down
45 changes: 21 additions & 24 deletions examples/cache/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Version Example
# Cache Example

This example exists primarily to test the following documentation:

* [`lando version`](https://docs.lando.dev/cli/version.html)
This example exists primarily to test the task caches

See the [Landofiles](https://docs.lando.dev/config/lando.html) in this directory for the exact magicks.

Expand All @@ -19,31 +17,30 @@ lando start
Run the following commands to verify things work as expected

```bash
# Should return the version
lando version | grep "v3."
# Should have both a global and app task cache after a start
cat ~/.lando/cache/_.tasks.cache
cat ~/.lando/cache/lando-cache.compose.cache

# Should clear the lando tasks cache
lando version
# Should not have either after a lando --clear
lando --clear
ls -lsa ~/.lando/cache | grep _.tasks.cache || echo $? | grep 1

# Should set the release channel as stable by default
lando config | grep "channel" | grep "stable"

# Should set the release channel based on the user option
lando --channel edge
lando config | grep "channel" | grep "edge"
lando --channel stable
lando config | grep "channel" | grep "stable"
cat ~/.lando/cache/_.tasks.cache || echo $? | grep 1
cat ~/.lando/cache/lando-cache.compose.cache || echo $? | grep 1

# Should not allow bogus release channels
lando --channel orange || echo $? | grep 1
# Should regenerate the caches on lando
lando --clear
lando || true
cat ~/.lando/cache/_.tasks.cache
cat ~/.lando/cache/lando-cache.compose.cache

# Should load plugins from pluginDirs
lando stuff | grep "I WORKED"
# Should regenerate the caches on any --help before the help is displayed
lando --clear
lando exec --help | grep service | grep choices | grep web | grep web2 | grep web3 | grep web4
cat ~/.lando/cache/_.tasks.cache
cat ~/.lando/cache/lando-cache.compose.cache

# Should load plugins specified in landofile
lando stuff2 | grep "I WORKED"
# Should remove the compose cache after a destroy
lando destroy -y
cat ~/.lando/cache/lando-cache.compose.cache || echo $? | grep 1
```

## Destroy tests
Expand Down

0 comments on commit 28d7df1

Please sign in to comment.