← Back to issue list

tests: refactor lxd launcher tests

View original Github issue

Metadata

Project
craft-providers
Number
#178
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #178 in commit 43146e2 refactored LXD launcher tests to distinguish regular instances from base instances, enabling the test coverage needed by #177.

Resolution: closed resolved

Reason: PR #178 was approved and merged as commit 43146e2. It reworked fixtures so instance and base-instance calls could be tested separately for the launcher change in #177.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- The unit tests in tests/unit/lxd/test_launcher.py were designed to work with a single instance. They use fixtures that do not distinguish which calls are made to which instance. This is preventing me from testing https://github.com/canonical/craft-providers/pull/177, where I need the tests to distinguish between and instance and a base instance. This PR refactors the fixtures and does a little cleanup. (CRAFT-1478)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #178 in commit 43146e2 refactored LXD launcher tests to distinguish regular instances from base instances, enabling the test coverage needed by #177.
qwen/qwen3.6-35b-a3b — closed resolved Merged PR refactoring tests/unit/lxd/test_launcher.py fixtures to distinguish between instances and base instances, enabling testing for craft-providers#177.

Update history

Date Change
created

Related work

  • Related To: canonical/craft-providers#177 (confidence 100%)

    PR #178 was explicitly created to enable testing the local-base-instance launcher change proposed in #177.

Related issues

Issue Project State Summary Similarity
#187 tests: improve lxd launcher tests for base instances craft-providers merged Merged in b0df595: expanded LXD base-instance tests, mocked _is_valid(), added lxc.info() integration coverage, and clarified an error message.
86%
#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.
75%
#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.
74%
#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.
72%
#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.
71%
#44 integration tests: consolidate lxd/multipass fixtures for reuse craft-providers merged Merged PR #44 in commit ee0f643, consolidating reusable LXD and Multipass integration-test fixtures and including a documentation fix.
71%
#467 test(spread): use LXD provider for spread tests imagecraft closed PR closed without merge; spread LXD provider changes were implemented across follow-up PRs (#483, #485, #486, #487, #488, #495)
71%
#3725 tests: use lxd in clean provider test snapcraft merged Merged PR #3725 (commit 61aaff6fc) into snapcraft/7.0, enabling LXD in provider-cleaning unit tests so they match destructive-mode test runs. Approved by one maintainer reviewer.
70%
#262 tests: install docker after lxd rockcraft merged Merged PR #262 as 64c5c01b, changing spread-test setup to install Docker after LXD and avoid order-dependent failures.
70%