@@ -129,9 +129,6 @@ def extract_metadata_from_test(test: Dict[str, Any]) -> Dict[Any, Any]:
129
129
return metadata
130
130
131
131
132
-
133
-
134
-
135
132
def get_datasource (data : Dict [Any , Any ]) -> str :
136
133
"""Gets es url from config or env
137
134
@@ -178,16 +175,12 @@ def filter_uuids_on_index(
178
175
ids = uuids
179
176
return ids
180
177
181
-
182
178
def get_build_urls (index : str , uuids : List [str ], match : Matcher ):
183
179
"""Gets metadata of the run from each test
184
180
to get the build url
185
-
186
181
Args:
187
182
uuids (list): str list of uuid to find build urls of
188
183
match: the fmatch instance
189
-
190
-
191
184
Returns:
192
185
dict: dictionary of the metadata
193
186
"""
@@ -218,23 +211,40 @@ def process_test(
218
211
logger .info ("The test %s has started" , test ["name" ])
219
212
fingerprint_index = test ["index" ]
220
213
221
- # getting metadata
222
- metadata = extract_metadata_from_test (test ) if options ["uuid" ] in ("" , None ) else get_metadata_with_uuid (options ["uuid" ], match )
223
- # get uuids, buildUrls matching with the metadata
224
- runs = match .get_uuid_by_metadata (metadata , fingerprint_index , lookback_date = start_timestamp , lookback_size = options ['lookback_size' ])
225
- uuids = [run ["uuid" ] for run in runs ]
226
- buildUrls = {run ["uuid" ]: run ["buildUrl" ] for run in runs }
227
- # get uuids if there is a baseline
214
+ # get uuids if there is a baseline and uuid set
228
215
if options ["baseline" ] not in ("" , None ):
216
+ # if baseline is set,
229
217
uuids = [uuid for uuid in re .split (r" |," , options ["baseline" ]) if uuid ]
230
218
uuids .append (options ["uuid" ])
231
- buildUrls = get_build_urls (fingerprint_index , uuids , match )
232
- elif not uuids :
219
+ runs = match .getResults ("" , uuids , fingerprint_index , {})
220
+
221
+ # get metadata of one run
222
+ metadata = get_metadata_with_uuid (options ["uuid" ], match )
223
+ else :
224
+ # getting metadata
225
+ metadata = extract_metadata_from_test (test ) if options ["uuid" ] in ("" , None ) else get_metadata_with_uuid (options ["uuid" ], match )
226
+ # get uuids, buildUrls matching with the metadata
227
+ # this match might not always work if UUID failed run, we still want to analyze
228
+ runs = match .get_uuid_by_metadata (metadata , fingerprint_index , lookback_date = start_timestamp , lookback_size = options ['lookback_size' ])
229
+
230
+ if options ['previous_version' ]:
231
+ last_version_run = runs
232
+ metadata ['ocpVersion' ] = str (float (metadata ['ocpVersion' ][:4 ]) - .01 )
233
+ runs = match .get_uuid_by_metadata (metadata , fingerprint_index , lookback_date = start_timestamp )
234
+
235
+ # get latest uuid as the "uuid" to compare against
236
+ last_uuid_run = last_version_run [- 1 ]
237
+ runs .append (last_uuid_run )
238
+
239
+
240
+ if not runs :
233
241
logger .info ("No UUID present for given metadata" )
234
242
return None , None
235
243
236
244
benchmark_index = test ["benchmarkIndex" ]
237
-
245
+ #Want to set uuid list right before usage
246
+ buildUrls = {run ["uuid" ]: run ["buildUrl" ] for run in runs }
247
+ uuids = [run ["uuid" ] for run in runs ]
238
248
uuids = filter_uuids_on_index (
239
249
metadata , benchmark_index , uuids , match , options ["baseline" ], options ['node_count' ]
240
250
)
0 commit comments