Fixed/simplified some tests to isolate them of underlying apt.
Metadata
Current evaluation
Merged PR #831 removed apt-dependent execution from parts/build tests, replacing a null plugin and simplifying build fixtures; merged as commit 6418a586.
Resolution: closed resolved
Reason: PR #831 was merged into main as commit 6418a586, with implementation commit cc069797, making the affected tests independent of underlying apt execution.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I started running the test suite in a different way and found that some tests failed because "couldn't run `apt`". That was totally a leak, and tests running apt scare me.
So I fixed/simplified them. In detail:
- `test_parts.TestPartsLifecycle.test_run_actions_progress`: used a "null plugin"; using the charm one was irrelevant for what is being tested (that progress was informed for the different actions).
- `test_build.test_build_basic_complete_structure`: this was more like an "integration test" from the very first days, it doesn't make much sense since the real charm building is responsibility of the `charm_builder.py` script, and it was patched more and more in the last months, and this was the final nail in the coffin. Its conceptual flaw is that it uses the external machinery and then check that the charm built ok, which of course needs *a real underlying execution*, which of course is not 100% possible in a test.
- `test_build.test_build_using_linters_attributes`: improved the test to use a better project setup (copied from other tests), which even lead to a minor simplification.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #831 removed apt-dependent execution from parts/build tests, replacing a null plugin and simplifying build fixtures; merged as commit 6418a586. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged charmcraft#831 to remove apt-dependent execution from unit tests, simplifying parts/build fixtures in commit cc069797 and merge commit 6418a586. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #831 isolated three tests from apt by using a null plugin, removing an overly integrated build test, and improving linter-test setup. | |
| stealth/space-bunny-alpha | — | closed resolved | PR #831 merged by facundobatista: removed apt-dependent execution from tests — swapped the null plugin for the charm plugin in test_run_actions_progress, deleted test_build_basic_complete_structure, and improved test_build_using_linters_attributes. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged test cleanup removed apt-dependent execution from parts/build tests, replaced a null plugin, and simplified build fixtures; two test files changed (+20/−76). | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #831 (6418a586): isolated three tests from apt, restored the null plugin, removed a flawed build integration test, and improved linter-test setup. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged test refactoring that isolates three tests from external apt dependencies. Replaced a charm plugin with a null plugin, removed a flawed integration test, and improved project setup for a linter test. CI passed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged by facundobatista. Fixed and simplified tests to remove apt dependencies by replacing the charm plugin with a null plugin, removing a flawed integration test, and improving the linter test setup. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3024 tests: remove usage of FakeApt fixtures in lifecycle | snapcraft | merged | Merged PR #3024 in commit ab892ee03, replacing lifecycle tests' FakeApt fixtures with targeted mock patches and related cleanup. | |
| #3025 tests: move FakeApt fixtures into deb tests | snapcraft | merged | Merged PR #3025 in commit 1237aa6, moving FakeApt fixtures from shared test support into the DEB tests after #3024 removed the remaining external uses. | |
| #1334 tests: use the fake apt cache in deb unit tests | snapcraft | merged | Merged PR #1334 as commit 3bcb730e0, updating deb unit tests to use a fake APT cache for better isolation and reliability. | |
| #199 tests: refactor plugin dependency tests | craft-parts | merged | PR #199 was merged, replacing redundant plugin dependency-test fixtures with a fixture factory; commit c668c180 landed via merge commit a3c5e087. | |
| #308 fix(inspectors/apt): rejection fix and additional tests | fetch-service | merged | Merged in #308 via commit ecf2e07: APT translation-file uncompression failures now reject the artifact instead of erroring, with additional inspector tests. |