feat: craft testing backend for lp-test#967
Conversation
4af3fff to
7ff9ba8
Compare
There was a problem hiding this comment.
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.
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.
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.
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.
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: |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
|
@cmatsuoka does this still need to be reviewed and merged? |
make lint && make test?docs/reference/changelog.rst)?Note for reviewers: see the expected output in tests.