From 4377a1b4850397cd13492eb39626b2c43a50c4a7 Mon Sep 17 00:00:00 2001 From: Andrew Ferlitsch Date: Wed, 8 Nov 2023 16:17:51 -0800 Subject: [PATCH] fix: bug in selection algo for age and max notebooks (#2475) * fix: invert time test * fix: percent unt --- .cloud-build/execute_changed_notebooks_cli.py | 2 +- .cloud-build/execute_changed_notebooks_helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cloud-build/execute_changed_notebooks_cli.py b/.cloud-build/execute_changed_notebooks_cli.py index 492937e45..dffc53462 100755 --- a/.cloud-build/execute_changed_notebooks_cli.py +++ b/.cloud-build/execute_changed_notebooks_cli.py @@ -166,7 +166,7 @@ else: notebooks = [changed_notebook for changed_notebook in changed_notebooks if execute_changed_notebooks_helper.select_notebook(changed_notebook, accumulative_results, args.test_percent)] # cap the number of notebooks to the specified percentage - max_notebooks = int((len(changed_notebooks) * args.test_percent)) + max_notebooks = int((len(changed_notebooks) * (args.test_percenti/100))) if (len(notebooks) > max_notebooks): notebooks = notebooks[:max_notebooks] diff --git a/.cloud-build/execute_changed_notebooks_helper.py b/.cloud-build/execute_changed_notebooks_helper.py index 193e70bf6..5341e665b 100755 --- a/.cloud-build/execute_changed_notebooks_helper.py +++ b/.cloud-build/execute_changed_notebooks_helper.py @@ -120,7 +120,7 @@ def load_results(results_bucket: str, if notebook in accumulative_results: accumulative_results[notebook]['passed'] += build_results[notebook]['passed'] accumulative_results[notebook]['failed'] += build_results[notebook]['failed'] - if accumulative_results[notebook]['last_time_ran'] > time_created: + if accumulative_results[notebook]['last_time_ran'] < time_created: accumulative_results[notebook]['last_time_ran'] = time_created else: accumulative_results[notebook] = build_results[notebook]