From 4e3657914efd4879bff201d93ac459458d7a493d Mon Sep 17 00:00:00 2001 From: Hugo Voisin Date: Wed, 17 Apr 2024 16:32:46 +0200 Subject: [PATCH] prune: remove unused script --- scripts/detect_ko_test.py | 47 --------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 scripts/detect_ko_test.py diff --git a/scripts/detect_ko_test.py b/scripts/detect_ko_test.py deleted file mode 100644 index f67e9bfee49..00000000000 --- a/scripts/detect_ko_test.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import sys -import json -import subprocess -from time import time - - -def verify_arguments(): - if (len(sys.argv) == 2): - return True - else: - print("Compatible with yarn packager and jest") - print("Usage: detetect_ko_test ") - return False - -def get_test_array(): - process = subprocess.Popen('cd ' + sys.argv[1] + ' && yarn jest --listTests --json', shell=True, stdout=subprocess.PIPE) - process.wait() - return json.loads(process.stdout.readlines()[2]) - -def get_test_name(test_path): - test_path_array = test_path.split('/') - return test_path_array[-1] - -def main(): - if(not(verify_arguments())): - return - test_list = get_test_array() - total_time = 0 - max_duration = 0 - longest_test = '' - for test in test_list: - timestmp = time() - print(get_test_name(test)) - process = subprocess.Popen('cd ' + sys.argv[1] + ' && yarn jest ' + test + ' --detectOpenHandles --runTestsByPath', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - process.wait() - test_time = time() - timestmp - total_time += test_time - if(test_time > max_duration): - max_duration = test_time - longest_test = get_test_name(test) - print('\033[31m' + '---- Time it took to do this test: ', str(test_time) + 's') - print('\033[39m') - print('Total time:', str(total_time) + 's') - print('Max duration is:', str(max_duration) + 's', 'For the test:', longest_test) - -main()