test(updater): exercise real MSIX detection in short-circuit test#129
Merged
Conversation
test_check_for_update_returns_none_on_msix mocked is_system_install -- the very function whose behaviour it claims to verify -- so it passed regardless of what the detection chain did. Reverting the win32 branch of is_system_install() to `return False` left the test green: false coverage on a load-bearing safety check. Patch only the environment the detection reads (sys.platform, the PACKAGE_FULL_NAME env var, sys.executable) plus the urlopen network boundary, so the genuine composition check_for_update -> is_system_install -> is_msix_install runs. Assert both that None is returned and that no HTTP request was attempted. A second case covers the load-bearing \WindowsApps\ path branch with the env var cleared. Both now fail against that mutant. Also add the artefacts-*/ spelling next to artifacts-*/ in .gitignore; the "e" variant was not covered and left local release artifacts showing up as untracked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying pdfapps with
|
| Latest commit: |
b15510e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b2c38d1f.pdfapps.pages.dev |
| Branch Preview URL: | https://chore-test-and-ignore-cleanu.pdfapps.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small cleanups flagged in review.
1. Tautological test in
tests/test_updater_msix.pytest_check_for_update_returns_none_on_msixmockedis_system_install— the exact function under test — so it asserted nothing beyond "a mock returns what I told it to". It survived mutation of the code it was supposed to guard.The test now patches only the environment the detection reads (
sys.platform,PACKAGE_FULL_NAME,sys.executable) plus theurlopennetwork boundary, so the real chaincheck_for_update -> is_system_install -> is_msix_installexecutes. It asserts both thatNoneis returned and that no HTTP request was attempted.A second case,
test_check_for_update_returns_none_on_msix_via_windowsapps_path, clears the env var so the load-bearing\WindowsApps\path branch is the only thing that can short-circuit.Mutation testing (proof it is now discriminative) — temporarily replaced the win32 branch of
is_system_install()withreturn False:test_check_for_update_returns_none_on_msixtest_check_for_update_returns_none_on_msix..._via_windowsapps_pathapp/updater.pywas restored byte-identical afterwards; it carries no change in this PR (git diffclean).2.
.gitignoreartifacts-*/(with an "i") did not cover theartefacts-*/spelling, leaving local release artifacts showing as untracked. Added the missing pattern alongside the existing one.Validation
pytest -q-> 442 passed, 2 skipped, 0 failed (441 baseline + 1 new test)ruff check tests/test_updater_msix.py-> All checks passedgit check-ignore -v artefacts-1.14.0/->.gitignore:23:artefacts-*/No production code changed; test-only plus one ignore pattern.
🤖 Generated with Claude Code