MCPcopy Create free account
hub / github.com/ceph/ceph / main

Function main

qa/workunits/dencoder/test_readable.py:311–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309
310
311def main():
312 global backward_compat
313 global incompat_paths
314
315 failed = 0
316 numtests = 0
317 task_batches = []
318 current_batch = []
319 batch_size = 100
320
321 backward_compat, incompat_paths = check_backward_compat()
322 debug_print(f'found {len(backward_compat)} backward incompatibilities')
323
324 for arversion_entry in sorted(DIR.joinpath("archive").iterdir(), key=lambda entry: entry.name):
325 arversion = arversion_entry.name
326 vdir = Path(DIR.joinpath("archive", arversion))
327
328 if not arversion_entry.is_dir() or not vdir.joinpath("objects").is_dir():
329 debug_print("skipping non-directory {}".format(arversion))
330 continue
331
332 for type_entry in vdir.joinpath("objects").iterdir():
333 type = type_entry.name
334 current_batch.append((type, vdir, arversion, current_ver))
335 if len(current_batch) >= batch_size:
336 task_batches.append(current_batch)
337 current_batch = []
338
339 if len(current_batch) > 0:
340 task_batches.append(current_batch)
341
342 full_unrecognized = []
343 for results in async_process_batches(task_batches):
344 for result in results:
345 _numtests, _failed, unrecognized = result
346 debug_print("numtests: {}, failed: {}".format(_numtests, _failed))
347 numtests += _numtests
348 failed += _failed
349 if unrecognized.strip() != '':
350 full_unrecognized.append(unrecognized)
351
352 if full_unrecognized is not None and len(full_unrecognized) > 0:
353 with open(temp_unrec, "a") as file_unrec:
354 file_unrec.writelines(line + "\n" for line in full_unrecognized)
355
356 if failed > 0:
357 print("FAILED {}/{} tests.".format(failed, numtests))
358 return 1
359
360 if numtests == 0:
361 print("FAILED: no tests found to run!")
362
363 print("Passed {} tests.".format(numtests))
364 return 0
365
366if __name__ == "__main__":
367 if len(sys.argv) < 1:

Callers 1

test_readable.pyFile · 0.70

Calls 8

check_backward_compatFunction · 0.85
debug_printFunction · 0.85
sortedFunction · 0.85
async_process_batchesFunction · 0.85
printFunction · 0.85
is_dirMethod · 0.45
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected