99from launchpad .artifacts .apple .zipped_xcarchive import ZippedXCArchive
1010from launchpad .artifacts .artifact import Artifact
1111from launchpad .constants import (
12+ DistributionState ,
1213 ProcessingErrorCode ,
1314 ProcessingErrorMessage ,
1415)
@@ -139,8 +140,7 @@ def test_processing_error_message_enum_values(self):
139140 assert ProcessingErrorMessage .SIZE_ANALYSIS_FAILED .value == "Failed to perform size analysis"
140141 assert ProcessingErrorMessage .UNKNOWN_ERROR .value == "An unknown error occurred"
141142
142- def test_do_distribution_unknown_artifact_type_reports_error (self ):
143- """Test that _do_distribution reports an error for unknown artifact types."""
143+ def test_do_distribution_unknown_artifact_type_skips (self ):
144144 mock_sentry_client = Mock (spec = SentryClient )
145145 mock_sentry_client .update_artifact .return_value = None
146146 self .processor ._sentry_client = mock_sentry_client
@@ -157,12 +157,12 @@ def test_do_distribution_unknown_artifact_type_reports_error(self):
157157 project = "test-project-id" ,
158158 artifact_id = "test-artifact-id" ,
159159 data = {
160- "error_code " : ProcessingErrorCode . ARTIFACT_PROCESSING_ERROR .value ,
161- "error_message " : ProcessingErrorMessage . UNSUPPORTED_ARTIFACT_TYPE . value ,
160+ "distribution_state " : DistributionState . NOT_RAN .value ,
161+ "distribution_skip_reason " : "unsupported" ,
162162 },
163163 )
164164
165- def test_do_distribution_invalid_code_signature_reports_error (self ):
165+ def test_do_distribution_invalid_code_signature_skips (self ):
166166 mock_sentry_client = Mock (spec = SentryClient )
167167 mock_sentry_client .update_artifact .return_value = None
168168 self .processor ._sentry_client = mock_sentry_client
@@ -179,13 +179,13 @@ def test_do_distribution_invalid_code_signature_reports_error(self):
179179 project = "test-project-id" ,
180180 artifact_id = "test-artifact-id" ,
181181 data = {
182- "error_code " : ProcessingErrorCode . ARTIFACT_PROCESSING_ERROR .value ,
183- "error_message " : ProcessingErrorMessage . INVALID_CODE_SIGNATURE . value ,
182+ "distribution_state " : DistributionState . NOT_RAN .value ,
183+ "distribution_skip_reason " : "invalid_signature" ,
184184 },
185185 )
186186 mock_sentry_client .upload_installable_app .assert_not_called ()
187187
188- def test_do_distribution_simulator_build_reports_error (self ):
188+ def test_do_distribution_simulator_build_skips (self ):
189189 mock_sentry_client = Mock (spec = SentryClient )
190190 mock_sentry_client .update_artifact .return_value = None
191191 self .processor ._sentry_client = mock_sentry_client
@@ -202,8 +202,8 @@ def test_do_distribution_simulator_build_reports_error(self):
202202 project = "test-project-id" ,
203203 artifact_id = "test-artifact-id" ,
204204 data = {
205- "error_code " : ProcessingErrorCode . ARTIFACT_PROCESSING_ERROR .value ,
206- "error_message " : ProcessingErrorMessage . SIMULATOR_BUILD . value ,
205+ "distribution_state " : DistributionState . NOT_RAN .value ,
206+ "distribution_skip_reason " : "simulator" ,
207207 },
208208 )
209209 mock_sentry_client .upload_installable_app .assert_not_called ()
0 commit comments