diff options
author | zsloan | 2022-09-06 13:32:28 -0500 |
---|---|---|
committer | GitHub | 2022-09-06 13:32:28 -0500 |
commit | d8bc7067b717e0b680d98b7cfcbc26c758a109bf (patch) | |
tree | 571677761b3bb464b55bc19f208f135214321ad2 /test/requests/test-website.py | |
parent | e0626f40d8fe4fa83daba52b82c1b459b34b1849 (diff) | |
parent | 363237f11b9eb14f52c4f0c43a931c99c827c496 (diff) | |
download | genenetwork2-d8bc7067b717e0b680d98b7cfcbc26c758a109bf.tar.gz |
Merge branch 'testing' into feature/generalize_tables
Diffstat (limited to 'test/requests/test-website.py')
-rwxr-xr-x | test/requests/test-website.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/requests/test-website.py b/test/requests/test-website.py index 71055fca..c0b36182 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -9,6 +9,7 @@ from link_checker import check_links from link_checker import check_packaged_js_files from mapping_tests import check_mapping from navigation_tests import check_navigation +from correlation_tests import check_correlations from main_web_functionality import check_main_web_functionality import link_checker import sys @@ -18,16 +19,30 @@ from unittest import TestSuite, TextTestRunner, TestLoader print("Mechanical Rob firing up...") +def host_is_online(host): + import time + import requests + for count in range(1, 5): + try: + time.sleep(count) + requests.get(host) + return True + except Exception as cre: + print(f"Retrying in {count + 1} seconds ...") + + return False def run_all(args_obj, parser): print("") print("Running all tests.") print(args_obj) + assert host_is_online(args_obj.host), f"Could not connect to {host}" link_checker.DO_FAIL = args_obj.fail check_main_web_functionality(args_obj, parser) check_links(args_obj, parser) check_packaged_js_files(args_obj, parser) check_mapping(args_obj, parser) + check_correlations(args_obj, parser) # TODO: Add other functions as they are created. |