← Back to issue list

unit tests: make lifecycle tests more robust

View original Github issue

Metadata

Project
snapcraft
Number
#2637
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged updates to improve lifecycle unit test robustness. Replaced strict message assertions with flexible checks to prevent fake webserver output from causing false failures. Approved and passed CI.

Suggested action:

No scores available.

Issue body

Some fake webserver messages can sneak into the checked for message output, using a more flexible check avoids this situation. Signed-off-by: Sergio Schvezov <sergio.schvezov@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 updates to improve lifecycle unit test robustness. Replaced strict message assertions with flexible checks to prevent fake webserver output from causing false failures. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged lifecycle test updates that replace strict message assertions with flexible checks, preventing fake webserver output from causing false failures. Codecov reported missing base coverage, but the changes were successfully integrated.
qwen3.6-35b-a3b-mtp-q6 Merged updates that enhance lifecycle unit test reliability by using flexible message checks instead of strict assertions, preventing false failures from unexpected webserver output.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1738 unit tests: make the check for output less strict snapcraft merged Merged following approval and passing CI. Unit test output assertions were relaxed to verify message content and format rather than exact strings, accommodating rogue log messages generated during log level setup.
79%
#4452 test(spread): check for new lifecycle message snapcraft merged Merged a test update to verify a new lifecycle message, resolving a regression from #4431. Approved by two reviewers with passing CI and stable coverage. The fix unblocks PR #4450.
75%
#2163 tests: add lifecycle ordering tests snapcraft merged Merged changes adding lifecycle ordering tests and refactoring them into a dedicated package. Approved by a reviewer, passed CI checks, and increased code coverage by 0.02%.
75%
#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.
74%
#3719 tests: fix lifecycle tests to run on new directory snapcraft merged Merged a fix for lifecycle tests to run in a new directory instead of the current one. Approved by a reviewer, passed CI, and changed three lines.
73%
#62 fix: improve lifecycle messages craft-application merged Merged into main after two approvals. Improved lifecycle messages and expanded human-readable text with all variances across three files. Minor coverage decrease was dismissed as a Codecov artifact.
73%
#391 fix(test): make endpoint tests less flaky craft-store merged Merged changes that stabilize endpoint tests in CI by reducing flakiness on slower machines. Approved with all CI checks passing. Minimal adjustments across two files resolve test instability.
72%
#757 fix(testing): improve testing messages craft-application merged Merged after two approvals and passing all CI checks. The update improves testing success reporting and provides clearer error messages on failure.
71%