fix: correct empty-upload test for create_commit options#717
Open
sentry[bot] wants to merge 1 commit into
Open
fix: correct empty-upload test for create_commit options#717sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
|
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.
This PR addresses issue CLI-EX, an
AssertionErrorin a test that expectedcreate_commit_logicto be called during anempty-uploadcommand invocation.The root cause was identified as an invalid CLI invocation within the test itself. The test was passing arguments to the
empty-uploadcommand that Click (the CLI framework) did not recognize or were missing required parameters (like--commit-sha). This caused Click to exit with a UsageError (exit code 2) before the command's logic, including the call tocreate_commit_logic, could ever execute.To fix this, a new test
test_invoke_empty_upload_send_commit_data_called_with_optionshas been added totests/commands/test_invoke_empty_upload.py. This test:send_commit_dataat its actual import path (codecov_cli.services.commit.send_commit_data).empty-upload, including a valid--commit-shaand other create-commit related options (--parent-sha,--branch,--pr).send_commit_datais called with the expected arguments, confirming theempty-uploadcommand correctly triggers commit creation with the provided options.This change ensures that the intended functionality of
empty-uploadcallingcreate_commit_logicis properly tested without encountering CLI argument parsing errors.Fixes CLI-EX