Skip to content

Commit ce859cf

Browse files
committed
Exit with a non-zero status code if upload does not finish
1 parent d641853 commit ce859cf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/fastlane/plugin/firebase_app_distribution/client/firebase_app_distribution_api_client.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ def upload(project_number, app_id, binary_path, platform)
159159
end
160160
end
161161
unless upload_status_response.success?
162-
UI.error("It took longer than expected to process your #{binary_type}, please try again.")
163-
return nil
162+
UI.crash!("It took longer than expected to process your #{binary_type}, please try again.")
164163
end
165164
end
166165
upload_status_response.release_id

spec/firebase_app_distribution_api_client_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
expect(release_id).to eq("release_id")
204204
end
205205

206-
it 'returns nil after polling MAX_POLLING_RETRIES times' do
206+
it 'raises an error after polling MAX_POLLING_RETRIES times' do
207207
max_polling_retries = 2
208208
stub_const("Fastlane::Client::FirebaseAppDistributionApiClient::MAX_POLLING_RETRIES", max_polling_retries)
209209

@@ -217,8 +217,9 @@
217217
.and_return(upload_status_response_in_progress)
218218
.exactly(max_polling_retries).times
219219

220-
release_id = api_client.upload("project_number", "app_id", fake_binary_path, "android")
221-
expect(release_id).to be_nil
220+
expect do
221+
api_client.upload("project_number", "app_id", fake_binary_path, "android")
222+
end.to raise_error
222223
end
223224

224225
it 'uploads the app binary once then polls until success' do

0 commit comments

Comments
 (0)