@@ -148,10 +148,6 @@ def _get_corpus_name(self, target_name): # pylint: disable=no-self-use
148
148
"""Returns the name of the corpus artifact."""
149
149
return target_name
150
150
151
- def _get_crashes_artifact_name (self ): # pylint: disable=no-self-use
152
- """Returns the name of the crashes artifact."""
153
- return 'current'
154
-
155
151
def upload_corpus (self , target_name , corpus_dir , replace = False ):
156
152
"""Upload the corpus produced by |target_name|."""
157
153
logging .info ('Uploading corpus in %s for %s.' , corpus_dir , target_name )
@@ -177,19 +173,24 @@ def upload_build(self, commit):
177
173
178
174
def upload_crashes (self ):
179
175
"""Uploads crashes."""
180
- if not os .listdir (self .workspace .artifacts ):
176
+ artifact_dirs = os .listdir (self .workspace .artifacts )
177
+ if not artifact_dirs :
181
178
logging .info ('No crashes in %s. Not uploading.' , self .workspace .artifacts )
182
179
return
183
180
184
- crashes_artifact_name = self ._get_crashes_artifact_name ()
181
+ for crash_target in artifact_dirs :
182
+ artifact_dir = os .path .join (self .workspace .artifacts , crash_target )
183
+ if not os .path .isdir (artifact_dir ):
184
+ logging .warning ('%s is not an expected artifact directory, skipping.' ,
185
+ crash_target )
186
+ continue
185
187
186
- logging .info ('Uploading crashes in %s.' , self .workspace .artifacts )
187
- try :
188
- self .filestore .upload_crashes (crashes_artifact_name ,
189
- self .workspace .artifacts )
190
- logging .info ('Done uploading crashes.' )
191
- except Exception as error : # pylint: disable=broad-except
192
- logging .error ('Failed to upload crashes. Error: %s' , error )
188
+ logging .info ('Uploading crashes in %s.' , artifact_dir )
189
+ try :
190
+ self .filestore .upload_crashes (crash_target , artifact_dir )
191
+ logging .info ('Done uploading crashes.' )
192
+ except Exception as error : # pylint: disable=broad-except
193
+ logging .error ('Failed to upload crashes. Error: %s' , error )
193
194
194
195
def upload_coverage (self ):
195
196
"""Uploads the coverage report to the filestore."""
0 commit comments