Skip to content

Commit dcb46da

Browse files
Merge pull request open5e#590 from open5e/better_smoke_test
More descriptive smoke test.
2 parents beac15b + 8a9e38c commit dcb46da

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

scripts/smoke_test.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,30 @@ def main():
1919
print("paths for 200 response codes. It is intended to be run post-deploy.")
2020

2121
# Check the root url.
22-
assert requests.get(args.url).status_code == 200
23-
22+
results = []
23+
results.append(check_for_OK(args.url))
2424
# Check the /v1 paths
25-
assert requests.get(args.url+'/v1/').status_code == 200
25+
results.append(check_for_OK(args.url+'/v1/'))
2626
v1_endpoints = requests.get(args.url+'/v1/?format=json').json()
2727
for value in v1_endpoints.values():
28-
assert requests.get(value).status_code == 200
28+
results.append(check_for_OK(value))
2929

3030
# Checking the /v2 paths
31-
assert requests.get(args.url+'/v2/').status_code == 200
31+
results.append(check_for_OK(args.url+'/v2/'))
3232
v2_endpoints = requests.get(args.url+'/v2/?format=json').json()
3333
for value in v2_endpoints.values():
34-
assert requests.get(value).status_code == 200
34+
results.append(check_for_OK(value))
35+
36+
for result in results:
37+
assert(result,"Path was not OK.")
38+
39+
def check_for_OK(url):
40+
r = requests.get(url)
41+
if r.status_code != 200:
42+
print("Got status {} on {}".format(r.status_code,url))
43+
return False
44+
return True
45+
3546

3647
if __name__ == '__main__':
3748
main()

0 commit comments

Comments
 (0)