-
Notifications
You must be signed in to change notification settings - Fork 19
feat: craft testing backend for lp-test #967
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
base: spike/launchpad-testing
Are you sure you want to change the base?
feat: craft testing backend for lp-test #967
Conversation
4af3fff to
7ff9ba8
Compare
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.
Pull request overview
This PR implements support for the lp-test backend in the craft testing framework. The lp-test backend uses OpenStack for running spread tests, as an alternative to the existing local lxd-vm backend or CI backend.
Key changes:
- Added automatic detection of lp-test backend when
LP_TEST_ACCOUNTenvironment variable is set - Implemented OpenStack backend configuration for lp-test with system image mappings for Ubuntu 20.04, 22.04, and 24.04
- Extended spread models to support OpenStack-specific fields (endpoint, account, key, location, plan, halt_timeout) and image specifications per system
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/unit/services/test_testing.py | Added comprehensive tests for both regular craft backend and lp-test backend spread file processing |
| tests/unit/models/test_spread.py | Updated existing tests with new images parameter and added test for lp-test backend transformation |
| craft_application/services/testing.py | Implemented lp-test backend detection, configuration, and image mapping for Ubuntu systems |
| craft_application/models/spread.py | Extended models to support image field in systems and OpenStack backend fields, updated transformation logic to handle image mapping |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
7ff9ba8 to
5bf3a17
Compare
| endpoint: str | None = None | ||
| account: str | None = None | ||
| key: str | None = None | ||
| location: str | None = None | ||
| plan: str | None = None | ||
| halt_timeout: str | None = None |
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.
IIUC halt_timeout applies to all backends. What about the rest of these?
The main reason I ask is because of https://github.com/lengau/spread-schema
|
|
||
| _SYSTEM_IMAGES = { | ||
| "lp-test": { | ||
| "ubuntu-20.04": "ubuntu-focal-daily-amd64", |
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.
Can lp-test use the ubuntu-minimal images?
| systems: | ||
| - ubuntu-24.04: | ||
| - ubuntu-22.04 | ||
| - ubuntu-20.04 |
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.
What's the expected behaviour if we had:
| - ubuntu-20.04 | |
| - ubuntu-20.04: | |
| image: ubuntu-focal-daily-amd64 | |
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Don't pipe output into stream if spread runs in interactive | ||
| if is_interactive: |
Copilot
AI
Dec 6, 2025
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 comment on line 222 is now disconnected from the conditional on line 223. Move the comment to line 223 (directly above the if statement) to maintain clarity.
| entry: dict[str, SpreadSystem] = {} | ||
| if isinstance(item, str): |
Copilot
AI
Dec 6, 2025
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 variable entry is declared before the isinstance check but only used in the else branch (line 188 onwards). Move the declaration to line 187 (after the continue statement) to scope it closer to its usage.
make lint && make test?docs/reference/changelog.rst)?Note for reviewers: see the expected output in tests.