Skip to content

Commit

Permalink
Fix metabox snap testing (#652)
Browse files Browse the repository at this point in the history
* Run black on lxd_proviuder and machine

* Install metabox provider in overlay

This installs the metabox provider in an overlay that is
automounted to the checkbox snap at boot. This is done to
avoid sideloading but also having a persistent install
of the metabox provider to be persistent across reboots.
Also, this uses the default loading mechanism of the snap
and it is closer to what it will do "in the wild"

* Document how to test snaps in README.md

* Minor: reformatted wonky indentation

* Fixed extra command in cmd
  • Loading branch information
Hook25 authored Aug 10, 2023
1 parent a5ce979 commit 9f16d82
Show file tree
Hide file tree
Showing 3 changed files with 328 additions and 106 deletions.
47 changes: 47 additions & 0 deletions metabox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,53 @@ configuration = {
**Note:** Metabox is always going to check **all possible combinations** of
`releases`, that means that this example will execute 9 test runs.

### Testing Checkbox Snaps

Metabox is able to test both locally built and store snaps.

To test a store snap you can use the following config:

```python
# The syntax and its meaning is similar to above, the following will run
# all local and remote tests for the focal snap
configuration = {
"local": {
"origin": "classic-snap",
# Use the store core snap on the "edge" channel
"checkbox_core_snap": {"risk": "edge"},
# Use the store frontend snap on the "edge" channel
"checkbox_snap": {"risk": "edge"},
"releases": ["focal"],
},
"remote": {
"origin": "classic-snap",
"checkbox_core_snap": {"risk": "edge"},
"checkbox_snap": {"risk": "edge"},
"releases": ["focal"],
},
"service": {
"origin": "classic-snap",
"checkbox_core_snap": {"risk": "edge"},
"checkbox_snap": {"risk": "edge"},
"releases": ["focal"],
},
}
```

To test a locally built snap you can use the following config:
```python
configuration = {
"local": {
"origin": "classic-snap",
"checkbox_core_snap": {"uri": "~/checkbox22.snap"},
# Note: you can mix and match, for example this uses a locally built
# snap for runtime but a store version of frontend
"checkbox_snap": {"risk": "edge"},
"releases": ["jammy"],
},
}
```

[Checkbox]: https://checkbox.readthedocs.io/
[Linux containers (LXC)]: https://linuxcontainers.org/
[`desktop_env` scenario]: ./metabox/scenarios/desktop_env/
Expand Down
Loading

0 comments on commit 9f16d82

Please sign in to comment.