tests: improve lxd launcher tests for base instances
Metadata
Current evaluation
Merged in b0df595: expanded LXD base-instance tests, mocked _is_valid(), added lxc.info() integration coverage, and clarified an error message.
Resolution: closed resolved
Reason: PR #187 was approved and merged as commit b0df595, completing the planned test-only cleanup and validation improvements.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Minor cleanup prior to adding support for expiring base instance.
- Add more assertions for lxd launcher to ensure the base instance mechanism is working.
- Mock `is_valid()` function
- Add an integration test for `lxc.info()`
- Clarify an error message
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in b0df595: expanded LXD base-instance tests, mocked _is_valid(), added lxc.info() integration coverage, and clarified an error message. | |
| qwen/qwen3.6-35b-a3b | — | closed resolved | Merged PR improving LXD launcher tests for base instances. Adds assertions for the base instance mechanism, mocks is_valid(), includes an lxc.info() integration test, and clarifies an error message. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #178 tests: refactor lxd launcher tests | craft-providers | merged | Merged PR #178 in commit 43146e2 refactored LXD launcher tests to distinguish regular instances from base instances, enabling the test coverage needed by #177. | |
| #2983 tests: add LXD spread test | snapcraft | merged | Merged PR #2983 as 4b8522a14, adding spread coverage that builds the LXD package with LXD and destructive/host providers; installation checks were deferred. | |
| #4239 spread: improve resilience of lxd-type-base test | snapcraft | merged | PR #4239 was squash-merged as ab2c13576, making the lxd-type-base spread test more resilient to frequent lxc stop timeouts on Google runners. | |
| #33 lxd: introduce LXDInstance | craft-providers | merged | Merged as commit 260c038, introducing LXDInstance, exposing the lxc fixture to LXD integration tests, and adding unit and integration coverage. | |
| #207 tests: split lxd integration tests | craft-providers | merged | Merged #207 to split LXD integration tests, resolving review feedback from #205; landed as commit 3eba5ca. | |
| #3326 lxd unit tests: simplify command checking pattern | snapcraft | merged | Merged PR #3326 (9c9381695) simplified LXD unit-test command checks, added a shared command prefix, removed environment-argument mocks, and cut 309 net lines. | |
| #996 fix: stop instance when base_configuration.setup() raises an error | craft-providers | merged | Merged PR #996 (commit 78367c2) fixes LXD launcher leaving instances running when base_configuration.setup() raises, by wrapping setup/stop in try/finally. Closes #447 and #757; supersedes earlier #947. Adds regression tests and ruff noqa updates. |