test(snap): add spread integration tests#1465
Open
zyga wants to merge 3 commits into
Open
Conversation
The integration test suite runs on typical Linux distribution images and ensures that openshell can create a sandbox and execute a hello-world program inside. Tests have two components: 1) The `image-garden` program uses built-in rules, as well as `.image-garden.mk` to prepare virtual machine images for testing. The virtual machines are vanilla cloud images booted once with a cloud-init profile that prepares them for testing. At runtime garden downloads images to ~/.cache/garden/dl or $SNAP_USER_COMMON/cache/dl (when using the snap) and then saves customized differential images in `.image-garden/` in the project directory. In practice the pre-created environment has snapd, the docker snap and the "ghcr.io/nvidia/openshell-community/sandboxes/base:latest" docker image pre-pulled for faster test iteration. 2) The `spread` program uses `spread.yaml` and a collection of `task.yaml` files to run tests. The top-level file defines the set of test systems, contains project wide preparation logic where we install the snap and defines a single test suite which corresponds to the `tests/` directory. An initial smoke test that creates a sandbox and ensures it can run a shell hello world is provided. This ensures that the locally built snap really works on the set of test environments: - centos-cloud-10 - debian-cloud-13 - fedora-cloud-44 - ubuntu-cloud-24.04 - ubuntu-cloud-26.04 Those tests are typically used with the `image-garden` snap, which also includes spread: https://snapcraft.io/image-garden/ Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Collaborator
|
/ok to test 6e77fc0 |
We need to give docker a moment to finish setting up. We an also add a docker system group while we are at it. With this setting it is worth to keep prepared images around in CI but the time advantage is worth it. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
CentOS 10 cloud image has a truncated checksum file causing each download to fail validation. Let's remove it from spread.yaml while keeping the .image-garden.mk entry for another day. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Collaborator
|
/ok to test 551d47f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
spreadsmoke test suite for the snap package.Related Issue
N/A
Changes
Testing
mise run pre-commitpassesChecklist
Please let me know if I should update architecture docs. The next step after this is to wire this all to GitHub to gate snap publishing on the smoke test passing.