Optionally serve test run details in full when no test name is provided.
This commit is contained in:
parent
c2669a07be
commit
b3bdeabaf3
@ -81,10 +81,14 @@ def _load_details(run_id, test_name):
|
||||
raise RunNotFoundException("Requested test run could not be found")
|
||||
|
||||
details_map = _cached_details[run_id]
|
||||
if test_name in details_map:
|
||||
return details_map[test_name]
|
||||
if test_name is None:
|
||||
return details_map
|
||||
else:
|
||||
raise TestNotFoundException("Requested test could not be found in run")
|
||||
if test_name in details_map:
|
||||
return details_map[test_name]
|
||||
else:
|
||||
raise TestNotFoundException(
|
||||
"Requested test could not be found in run")
|
||||
|
||||
|
||||
class TempestRunRawEndpoint(Endpoint):
|
||||
@ -98,6 +102,6 @@ class TempestRunTreeEndpoint(Endpoint):
|
||||
|
||||
|
||||
class TempestRunDetailsEndpoint(Endpoint):
|
||||
def get(self, request, run_id, test_name):
|
||||
def get(self, request, run_id, test_name=None):
|
||||
return _load_details(run_id, test_name)
|
||||
|
||||
|
@ -28,9 +28,10 @@ urlpatterns = patterns('',
|
||||
url(r'^api_raw_(?P<run_id>\d+).json$',
|
||||
TempestRunRawEndpoint.as_view(),
|
||||
name='tempest_api_raw'),
|
||||
url(r'^api_details_(\d+)_([^/]+).json$',
|
||||
TempestRunDetailsEndpoint.as_view(),
|
||||
name='tempest_api_details'),
|
||||
url(r'^api_details_(?P<run_id>\d+).json$',
|
||||
TempestRunDetailsEndpoint.as_view()),
|
||||
url(r'^api_details_(?P<run_id>\d+)_(?P<test_name>[^/]+).json$',
|
||||
TempestRunDetailsEndpoint.as_view()),
|
||||
|
||||
url(r'^aggregate.html$',
|
||||
AggregateResultsView.as_view(),
|
||||
|
Loading…
Reference in New Issue
Block a user