Repository navigation
Count only the matching warning in the plugin sync 403 test - #574
Merged
Merged
Conversation
On a 403 the service logs two warnings: one from the tag lookup's catch and one from sync(). The test called once() before with(), and Mockery checks the count as soon as once() runs, so it counted both warnings and failed. Putting with() first makes once() apply to the "Could not discover latest release" warning only. Main has failed this test since #553. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
test_sync_does_not_read_default_branch_when_release_discovery_failshas failed on main since #553, so every PR's Tests check is red (#573 included).On a 403 the service logs two warnings:
Failed to fetch latest tag for ...from the catch in the tag lookup, then[PluginSync] Could not discover latest releasefromsync(). The test called->once()before->with(...). Mockery checks the count as soon asonce()runs, before the argument matcher is attached, so it counted both warnings and failed with "called 2 times".The fix moves
once()afterwith(), so the test still checks that the "Could not discover latest release" warning is logged exactly once. No app code changes.Testing: the test fails on main and passes with this change. All 13 tests in
PluginSyncServiceTestpass. Changing it totwice()makes it fail again, so the count is still being checked. Pint passes. I didn't run the full suite locally; CI will.🤖 Generated with Claude Code