Skip to content

Commit

Permalink
Add file id and name informations in files/:id/junit endpoint
Browse files Browse the repository at this point in the history
To improve the user interface, we need the file name when we get the junit endpoint.

Change-Id: I009ddfc0d17c869b8dfaed439dc8f23ff6574a97
  • Loading branch information
rh-gvincent committed Dec 13, 2024
1 parent 2a34523 commit dcc2d7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dci/api/v1/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ def get_junit_file(user, file_id):
return flask.Response(
json.dumps(
{
"id": str(file_id),
"name": file.name,
"job": {"id": job.id, "name": job.name},
"previous_job": previous_job_info,
"testsuites": junit.update_testsuites_with_testcase_changes(
Expand Down
2 changes: 2 additions & 0 deletions tests/api/v1/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ def test_get_junit_file(_, user, job_user):
)["id"]
data = user.get("/api/v1/files/%s/junit" % junit_id).data
assert len(data["testsuites"]) == 1
assert data["id"] == junit_id
assert data["name"] == "Tempest"
assert data["job"]["id"] == job_user["id"]
assert data["job"]["name"] == job_user["name"]
assert data["previous_job"] is None
Expand Down

0 comments on commit dcc2d7a

Please sign in to comment.