Fixed/simplified some tests to isolate them of underlying apt.
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes that fixed and simplified tests to remove underlying apt dependencies. Replaced a charm plugin with a null plugin, removed a flawed integration test, and improved project setup for a linter test to ensure proper isolation. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #998 refactor: isolate the charm lib internals extractor | charmcraft | merged | Merged a refactoring that isolates the charm lib internals extractor to prepare for AST-based parsing. Code and tests were reorganized without functional changes, with some tests collapsed via parametrize. Approved and passed CI. | |
| #3024 tests: remove usage of FakeApt fixtures in lifecycle | snapcraft | merged | Merged changes replacing FakeApt fixtures in lifecycle tests with targeted mock.patch calls and related cleanup. Approved by one reviewer and passed CI checks. | |
| #1326 fix(test): fix reactive plugin test if 'charm' tool is installed | charmcraft | merged | Merged a fix for the reactive plugin test that failed when the charm tool was installed. Approved by two reviewers with a +5/-1 line change. Resolves the test compatibility issue. | |
| #3025 tests: move FakeApt fixtures into deb tests | snapcraft | merged | Merged to relocate FakeApt test fixtures into the deb test suite, eliminating external dependencies and enabling safe modifications. Approved by a reviewer, passed CI, and modified three files with a net reduction of four lines. |