forked from googleapis/python-aiplatform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_flaky_test_diagnostic.py
More file actions
22 lines (19 loc) · 869 Bytes
/
run_flaky_test_diagnostic.py
File metadata and controls
22 lines (19 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import pathlib
import sys
# Run test in snippets directory:
dir_of_curr_file = os.path.dirname(__file__)
helper_filepath = pathlib.Path(dir_of_curr_file).parent / 'samples' / 'snippets'
sys.path.append(helper_filepath.resolve().as_posix())
os.chdir(helper_filepath.resolve())
from helpers import flaky_test_diagnostic
# Settings:
file_name = 'pipeline_service/create_training_pipeline_tabular_regression_sample_test.py'
test_name = 'test_ucaip_generated_create_training_pipeline_sample'
timing_dict = flaky_test_diagnostic(file_name, test_name, N=1)
for key, delta_list in timing_dict.items():
mean_time = sum(delta_list)/len(delta_list)
max_time = max(delta_list)
min_time = min(delta_list)
report_string = f'Result: {key}, mean={mean_time:3.2f}, min={min_time:3.2f}, max={max_time:3.2f}, count={len(delta_list)}'
print(report_string)