← Back to issue list

test(plugins): split package install command tests

View original Github issue

Metadata

Project
charmcraft
Number
#2853
Type
pull request
State
open
Author
hawkxdev
Labels
—
Created
Updated
Closed
—

Current evaluation

Test-only refactor splitting test_get_package_install_commands into per-behaviour tests for python/poetry/uv plugins, adding a plugins/conftest.py make_plugin factory and dropping pytest_check. Approved, CLA green, awaiting maintainer merge.

Suggested action: needs review

Reason: Review status is 'approved (1 reviewers)' with CI fully green (Canonical CLA passing, none failing/pending), and the diff is test-only with no product code touched, so it is essentially ready to land. The single unresolved review comment is still outstanding and hawkxdev's latest comment (2026-09-13) explicitly asks @lengau 'Anything else?', so a maintainer decision is pending; impact is minimal because only unit tests change.

Evaluated by: mr-cal-bot

Impact: 15 Quick Win: 8 Complexity: 30 Confidence: 74 Actionability: 80

Issue body

## Description Splits `test_get_package_install_commands` in the plugin unit tests into focused tests, one behaviour each, as discussed in #2849. ### Changes: - Add `tests/unit/parts/plugins/conftest.py` with a `make_plugin` factory fixture and copy-command helpers, replacing the plugin construction duplicated across the three files. - In `tests/unit/parts/plugins/test_python.py`, split the test into pip options, build-subdir resolution, copy commands per existing directory, and parent-directory exclusion. - Apply the same split to `test_poetry.py` and `test_uv.py`. - Replace `pytest_check` soft checks with plain `assert` now that each test covers a single phase. Fixes #2849

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 15
Quick Win: 8
Complexity: 30
Confidence: 74
Actionability: 80
needs review Test-only refactor splitting test_get_package_install_commands into per-behaviour tests for python/poetry/uv plugins, adding a plugins/conftest.py make_plugin factory and dropping pytest_check. Approved, CLA green, awaiting maintainer merge.
stealth/space-bunny-alpha
Impact: 28
Quick Win: 13
Complexity: 42
Confidence: 84
Actionability: 80
needs review Test-only refactor: splits test_get_package_install_commands into per-behaviour tests for python/poetry/uv plugins, adds tests/unit/parts/plugins/conftest.py with a make_plugin factory, and drops pytest_check. Approved, CI green, awaiting merge.
stealth/space-bunny-alpha
Impact: 20
Quick Win: 11
Complexity: 34
Confidence: 92
Actionability: 83
needs review Splits plugin package-install command tests for pip, Poetry, and uv into focused cases and adds shared fixtures. All CI checks pass; the change remains unreviewed and pending maintainer feedback.
stealth/space-bunny-alpha
Impact: 15
Quick Win: 8
Complexity: 32
Confidence: 94
Actionability: 82
needs review Splits Python, Poetry, and uv package-install command tests into focused cases, adds a shared plugin factory fixture, and replaces soft checks with assertions; CI is green and awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Impact: 10
Quick Win: 8
Staleness: 25
Complexity: 15
Confidence: 75
needs review Refactors plugin unit tests by splitting test_get_package_install_commands into focused single-behaviour tests across test_python.py, test_poetry.py, and test_uv.py, with a shared conftest.py fixture. CI passing, awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Impact: 20
Quick Win: 17
Staleness: 10
Complexity: 15
Confidence: 75
needs review Splits test_get_package_install_commands into focused unit tests across python, poetry, and uv plugins with a shared conftest fixture. Fresh PR with 0 reviewers and 1 unresolved review comment.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Splits plugin package install command tests into focused unit tests, adds shared fixtures in conftest.py, and replaces soft checks with plain asserts. Currently pending review with one unresolved comment and passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Splits plugin package install command tests into focused unit tests, adds shared fixtures in conftest.py, and replaces soft checks with standard asserts. Currently pending maintainer review with one unresolved comment and passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 85
needs review Splits plugin package install tests into focused unit tests, adds shared fixtures in conftest, replaces soft checks with asserts. Currently awaiting maintainer review with CI passing.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Splits plugin package install command tests into focused unit tests, adds shared fixtures in conftest.py, and replaces soft checks with standard assertions. Currently awaiting maintainer review with passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 20
Confidence: 90
needs review Splits plugin package install command tests into focused unit tests, introduces shared fixtures in conftest.py, and replaces soft assertions with standard asserts. Currently awaiting maintainer review with passing CI.

Update history

Date Change
updated
updated
updated
updated
updated
updated
created

Related work

  • Related To: canonical/charmcraft#2849 (confidence 95%)

    Tracking issue 'Refactor: Split up plugin tests' that this PR states it fixes; issue is open, triaged as good first issue and assigned to hawkxdev, so it will close partially once this lands.

Related issues

Issue Project State Summary Similarity
#1944 tests: split the plugins tests in the same directory snapcraft merged Merged PR #1944 in commit 2dd0377e9, consolidating split plugin test suites in one package so Python 3.6 unittest discovery no longer failed on directories missing __init__.py.
73%