MCPcopy Index your code
hub / github.com/modelscope/modelscope / run_in_subprocess

Function run_in_subprocess

tests/run.py:389–436  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

387
388
389def run_in_subprocess(args):
390 test_suite_files = gather_test_suites_files(
391 os.path.abspath(args.test_dir), args.pattern)
392
393 non_parallelizable_suites = [
394 'test_download_dataset.py',
395 'test_hub_examples.py',
396 'test_hub_operation.py',
397 'test_hub_private_files.py',
398 'test_hub_private_repository.py',
399 'test_hub_repository.py',
400 'test_hub_retry.py',
401 'test_hub_revision.py',
402 'test_hub_revision_release_mode.py',
403 'test_hub_upload.py',
404 'test_custom_pipeline_cmd.py',
405 'test_download_cmd.py',
406 'test_modelcard_cmd.py',
407 'test_plugins_cmd.py',
408 ]
409 test_suite_files = [
410 x for x in test_suite_files if x not in non_parallelizable_suites
411 ]
412
413 isolated_cases = []
414 if args.subprocess: # run all case in subprocess
415 isolated_cases = test_suite_files
416
417 with tempfile.TemporaryDirectory() as temp_result_dir:
418 # first run cases that nonparallelizable
419 run_non_parallelizable_test_suites(non_parallelizable_suites,
420 temp_result_dir)
421
422 # run case parallel
423 parallel_run_case(isolated_cases, temp_result_dir, args.parallel)
424
425 # collect test results
426 result_dfs = []
427 result_path = Path(temp_result_dir)
428 for result in result_path.iterdir():
429 if Path.is_file(result):
430 df = pandas.read_pickle(result)
431 result_dfs.append(df)
432 result_pd = pandas.concat(
433 result_dfs) # merge result of every test suite.
434 print_table_result(result_pd)
435 print_abnormal_case_info(result_pd)
436 statistics_test_result(result_pd)
437
438
439def get_object_full_name(obj):

Callers 1

run.pyFile · 0.85

Calls 7

gather_test_suites_filesFunction · 0.85
parallel_run_caseFunction · 0.85
print_table_resultFunction · 0.85
print_abnormal_case_infoFunction · 0.85
statistics_test_resultFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…