Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
api/views.py: return recently created testrun after api/submit call
Browse files Browse the repository at this point in the history
This will assist further usage of whatever has been created within
the testrun.

Signed-off-by: Charles Oliveira <[email protected]>
  • Loading branch information
chaws committed Nov 10, 2023
1 parent 789bfe1 commit 515df4a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ should be automated with a driver program that asks for user input, and
them at the end prepares all the data in a consistent way, and submits
it to dashboard.

If input data is valid and nothing goes wrong with the request, SQUAD
will return 201 as status code and the test run id in the response body.

Input file formats
------------------

Expand Down
2 changes: 1 addition & 1 deletion squad/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def add_test_run(request, group_slug, project_slug, version, environment_slug):
logger.warning(request.get_full_path() + ": " + str(e))
return HttpResponse(str(e), status=400)

return HttpResponse('', status=201)
return HttpResponse(str(testrun.id), status=201)


@csrf_exempt
Expand Down
1 change: 1 addition & 0 deletions test/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def test_create_object_hierarchy(self):
object_id=testrun.pk,
object_repr=force_text(testrun),
)
self.assertEqual(str(response.content.decode()), str(testrun.id))
self.assertEqual(
1,
logentry_queryset.count()
Expand Down

0 comments on commit 515df4a

Please sign in to comment.