Help Center/ CodeArts Build/ API Reference/ APIs/ Build Reports/ Uploading a Unit Test Report
Updated on 2025-12-10 GMT+08:00

Uploading a Unit Test Report

Function

This API is used to upload the unit test report of a specific build action by referencing its ID.

Calling Method

For details, see Calling APIs.

URI

POST /v1/report/junit/report/upload

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Definition

Build task ID.

It includes digits and letters. To obtain this ID, open the page for editing the build task in your browser, and copy the 32-character string at the end of the URL.

Constraints

N/A.

Range

The 32-character string sits at the end of the URL and includes digits and letters.

Default Value

N/A.

build_no

Yes

Integer

Definition

The build number tracks each run of the build task. This parameter starts at 1, indicating the first build. It increments by 1 for every subsequent run.

Constraints

The value is a positive integer.

Range

Use only numbers that are 1 or greater.

Default Value

1

node_id

Yes

String

Definition

Build action ID. Use the value of node_id in the response body of the API that retrieves the full stages of a task.

Constraints

The value can contain a maximum of 32 characters. Digits, letters, and hyphens (-) are supported.

Range

N/A.

Default Value

N/A.

Request Parameters

Table 2 FormData parameters

Parameter

Mandatory

Type

Description

files

No

Array of files

Definition

Uploaded unit test report files.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

API response status.

Range

success: The API call is successful.

fail: The API call failed.

error

Object

Definition

Error message.

Range

N/A.

result

String

Definition

Data returned after the API is successfully called.

Range

N/A.

Example Requests

POST https://{endpoint}/v1/report/junit/report/upload

Example Responses

Status code: 200

OK

{
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.