← Back to issue list

tests: add missing mock for rust unit tests

View original Github issue

Metadata

Project
snapcraft
Number
#3376
Type
pull request
State
merged
Author
cjp256
Labels
Created
Updated
Closed

Current evaluation

Merged a fix for failing cross-compilation unit tests when rustup is present. The change mocks os.path.exists() to return False during the pull step, preventing test failures. Approved by maintainer and passed all CI checks.

Suggested action:

No scores available.

Issue body

If the rustup command exists on host, the cross compilation unit tests will fail. Simply mock the pull() step to return False for os.path.exists(). Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged a fix for failing cross-compilation unit tests when rustup is present. The change mocks os.path.exists() to return False during the pull step, preventing test failures. Approved by maintainer and passed all CI checks.
qwen3.6-35b-a3b-mtp-q6 Merged a fix adding a missing mock for os.path.exists() in the pull() step, preventing cross-compilation unit test failures when rustup is present on the host.
qwen3.6-35b-a3b-mtp-q6 Merged a fix adding a missing mock for os.path.exists() in the pull() step. This resolves cross-compilation unit test failures when rustup is present on the host system.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#577 test: rust plugin unit tests - remove system requirements craft-parts merged Merged after three approvals. The update removes the local Rust installation requirement for running rust plugin unit tests. Initial CI code-style failures were fixed prior to successful merge.
71%
#713 rust plugin: mock downloads in unit tests snapcraft merged Merged a +7/-1 change to mock downloads in unit tests for the Rust plugin, resolving LP #1610996. The update received informal approval and was integrated without formal CI checks or reviewer sign-off.
70%