File tree Expand file tree Collapse file tree 3 files changed +21
-31
lines changed Expand file tree Collapse file tree 3 files changed +21
-31
lines changed Original file line number Diff line number Diff line change 25
25
"--pr" ,
26
26
"--pull-request-number" ,
27
27
"pull_request_number" ,
28
- help = "Specify the pull request number mannually . Used to override pre-existing CI environment variables" ,
28
+ help = "Specify the pull request number manually . Used to override pre-existing CI environment variables" ,
29
29
cls = CodecovOption ,
30
30
fallback_field = FallbackFieldEnum .pull_request_number ,
31
31
)
@@ -55,20 +55,19 @@ def empty_upload(
55
55
enterprise_url = ctx .obj .get ("enterprise_url" )
56
56
args = get_cli_args (ctx )
57
57
58
- if parent_sha and pull_request_number and branch :
59
- logger .debug ("Attempting to Create Commit before doing an empty upload." )
60
- create_commit_logic (
61
- commit_sha ,
62
- parent_sha ,
63
- pull_request_number ,
64
- branch ,
65
- slug ,
66
- token ,
67
- git_service ,
68
- enterprise_url ,
69
- fail_on_error ,
70
- args ,
71
- )
58
+ logger .debug ("Attempting to Create Commit before doing an empty upload." )
59
+ create_commit_logic (
60
+ commit_sha ,
61
+ parent_sha ,
62
+ pull_request_number ,
63
+ branch ,
64
+ slug ,
65
+ token ,
66
+ git_service ,
67
+ enterprise_url ,
68
+ fail_on_error ,
69
+ args ,
70
+ )
72
71
73
72
logger .debug (
74
73
"Starting empty upload process" ,
Original file line number Diff line number Diff line change @@ -151,6 +151,13 @@ Usage: codecovcli empty-upload [OPTIONS]
151
151
152
152
Options:
153
153
--force
154
+ --parent-sha TEXT SHA (with 40 chars) of what should be the
155
+ parent of this commit
156
+ -P, --pr, --pull-request-number TEXT
157
+ Specify the pull request number mannually.
158
+ Used to override pre-existing CI environment
159
+ variables
160
+ -B, --branch TEXT Branch to which this commit belongs to
154
161
-C, --sha, --commit-sha TEXT Commit SHA (with 40 chars) [required]
155
162
-Z, --fail-on-error Exit with non-zero code in case of error
156
163
--git-service [github|gitlab|bitbucket|github_enterprise|gitlab_enterprise|bitbucket_server]
Original file line number Diff line number Diff line change @@ -23,19 +23,3 @@ def test_invoke_empty_upload_with_create_commit(mocker):
23
23
create_commit_mock .assert_called_once ()
24
24
empty_upload_mock .assert_called_once ()
25
25
26
- def test_invoke_empty_upload_no_create_commit (mocker ):
27
- create_commit_mock = mocker .patch ("codecov_cli.commands.empty_upload.create_commit_logic" )
28
- empty_upload_mock = mocker .patch ("codecov_cli.commands.empty_upload.empty_upload_logic" )
29
-
30
- fake_ci_provider = FakeProvider ({FallbackFieldEnum .commit_sha : None })
31
- mocker .patch ("codecov_cli.main.get_ci_adapter" , return_value = fake_ci_provider )
32
-
33
- runner = CliRunner ()
34
- result = runner .invoke (cli , ["empty-upload" ,
35
- "-C" , "command-sha" ,
36
- "--slug" , "owner/repo" ], obj = {})
37
- assert result .exit_code == 0
38
-
39
- create_commit_mock .assert_not_called ()
40
- empty_upload_mock .assert_called_once ()
41
-
You can’t perform that action at this time.
0 commit comments