-
Notifications
You must be signed in to change notification settings - Fork 3
Add integration tests with minimal toy spread project #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
949ac56
Initial plan
Copilot 7c54d6d
Add integration tests with minimal toy spread project
Copilot f1e016d
Add .image-garden/README.md and fix .gitignore pattern
Copilot 47a044d
Fix system name to use ubuntu-cloud-24.04 instead of ubuntu-24.04
Copilot 27366b7
Initial plan
Copilot 441cf10
Initial plan
Copilot bd10d1b
Fix cache actions: remove working-directory and combine paths with sp…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Canonical Ltd. | ||
| name: Integration Tests | ||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| jobs: | ||
| toy-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Run toy integration test | ||
| uses: ./ | ||
| with: | ||
| garden-system: ubuntu-cloud-24.04 | ||
| spread-subdir: tests/toy |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Canonical Ltd. | ||
| .image-garden/* | ||
| !.image-garden/README.md |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Canonical Ltd. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| SPDX-FileCopyrightText: Canonical Ltd. | ||
| --> | ||
|
|
||
| # Image Garden State Directory | ||
|
|
||
| This directory is used by `image-garden` to store large temporary files. | ||
| It should be ignored in `.gitignore` apart from this `README.md` file | ||
| itself. | ||
|
|
||
| Consult documentation of [spread](https://github.com/canonical/spread) and | ||
| [image-garden](https://gitlab.com/zygoon/image-garden). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Canonical Ltd. | ||
| project: toy | ||
| path: /root/toy | ||
| exclude: | ||
| - .image-garden/ | ||
| - .git | ||
| backends: | ||
| garden: | ||
| type: adhoc | ||
| allocate: | | ||
| if [ -n "${SPREAD_HOST_PATH-}" ]; then | ||
| PATH="$SPREAD_HOST_PATH" | ||
| fi | ||
| exec image-garden allocate "$SPREAD_SYSTEM"."$(uname -m)" | ||
| discard: | | ||
| if [ -n "${SPREAD_HOST_PATH-}" ]; then | ||
| PATH="$SPREAD_HOST_PATH" | ||
| fi | ||
| exec image-garden discard "$SPREAD_SYSTEM_ADDRESS" | ||
| systems: | ||
| - ubuntu-cloud-24.04: | ||
| username: root | ||
| password: root | ||
| suites: | ||
| tests/: | ||
| summary: Toy integration tests |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Canonical Ltd. | ||
| summary: Simple success test that prints hello world | ||
| execute: | | ||
| echo "hello world" | ||
| echo "Integration test successful!" |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hashFiles condition should respect the spread-subdir input parameter. When spread-subdir is set to a non-default value (like 'tests/toy'), this condition will look for '.image-garden.mk' in the wrong location (repository root instead of the subdirectory). This is inconsistent with line 87 which correctly uses format to construct the path with spread-subdir, and with line 91 which sets working-directory to the spread-subdir. The condition should use format to construct the correct path, similar to line 87.