diff --git a/scripts/smoke_test.py b/scripts/smoke_test.py index 864902a5..f35a1631 100644 --- a/scripts/smoke_test.py +++ b/scripts/smoke_test.py @@ -19,19 +19,30 @@ def main(): print("paths for 200 response codes. It is intended to be run post-deploy.") # Check the root url. - assert requests.get(args.url).status_code == 200 - + results = [] + results.append(check_for_OK(args.url)) # Check the /v1 paths - assert requests.get(args.url+'/v1/').status_code == 200 + results.append(check_for_OK(args.url+'/v1/')) v1_endpoints = requests.get(args.url+'/v1/?format=json').json() for value in v1_endpoints.values(): - assert requests.get(value).status_code == 200 + results.append(check_for_OK(value)) # Checking the /v2 paths - assert requests.get(args.url+'/v2/').status_code == 200 + results.append(check_for_OK(args.url+'/v2/')) v2_endpoints = requests.get(args.url+'/v2/?format=json').json() for value in v2_endpoints.values(): - assert requests.get(value).status_code == 200 + results.append(check_for_OK(value)) + + for result in results: + assert(result,"Path was not OK.") + +def check_for_OK(url): + r = requests.get(url) + if r.status_code != 200: + print("Got status {} on {}".format(r.status_code,url)) + return False + return True + if __name__ == '__main__': main() \ No newline at end of file