Generate report
Spintest is now able to generate report.
how to use it
On the spintest call, add the new argument generate_report=[PATH_OF_REPORT]
- example
result = spintest(
["http://test.com"],
[
{"method": "GET", "route": "/test", "output": "test"},
{"method": "GET", "route": "/{{ test['foo'] }}"},
],
generate_report="/tmp/spintest_report/test_report.json",
)
-
Report will be present on path = "/tmp/spintest_report/test_report.json"
-
Report look like :
[{"url": "http://test.com", "reports": [{"name": null, "status": "SUCCESS", "timestamp": "Fri Jun 26 14:31:05 2020", "duration_sec": 0.11, "url": "http://test.com", "route": "/test", "message": "OK.", "code": 200, "body": "Hello!", "task": {"method": "GET", "route": "/test", "delay": 1, "ignore": false, "retry": 0, "headers": {"Accept": "application/json", "Content-Type": "application/json"}, "duration_sec": 0.11}, "ignore": false, "output": {"__token__": "***"}}, {"name": null, "status": "SUCCESS", "timestamp": "Fri Jun 26 14:31:05 2020", "duration_sec": 0.11, "url": "http://test.com", "route": "/test", "message": "OK.", "code": 200, "body": "Hello!", "task": {"method": "GET", "route": "/test", "delay": 1, "ignore": false, "retry": 0, "headers": {"Accept": "application/json", "Content-Type": "application/json"}, "duration_sec": 0.11}, "ignore": false, "output": {"__token__": "***"}}], "total_duration_sec": 0.22}]