- 主要流程
- codeZone
- codeZoneResource
- codeZoneMiddleware
- codeZoneSnapshot
- unitTest
- git-codeZone
- docker
- git-docker
- unitTestFramework
- environment
- middleware
- playground
- git-playground
- playgroundUnitTest
- DiskResource
- URLResource
- ticket
- playgroundMiddleware
- nix
- file
- mq
- IDE Server
运行单元测试
POST
/api/v1/sdk/playgrounds/{playgroundId}/unitTests/run
playgroundUnitTest
请求参数
Path 参数
playgroundId
integer <int64>
必需
Header 参数
tenantCode
string
租户code
默认值:
demo
userId
string
租户系统用户Id
默认值:
2
nonce
string
必需
默认值:
{{nonce}}
timestamp
string
必需
默认值:
{{timestamp}}
token
string
必需
默认值:
{{token}}
Body 参数application/json
consoleText
string
可选
fileKey
string
文件 Key
methodName
string
可选
needCompileFileKey
array[string]
可选
outputConsole
boolean
可选
runMode
boolean
可选
示例
{
"consoleText": "string",
"fileKey": "string",
"methodName": "string",
"needCompileFileKey": [
"string"
],
"outputConsole": true,
"runMode": true
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/sdk/playgrounds//unitTests/run' \
--header 'tenantCode;' \
--header 'userId;' \
--header 'nonce;' \
--header 'timestamp;' \
--header 'token;' \
--header 'Content-Type: application/json' \
--data-raw '{
"consoleText": "string",
"fileKey": "string",
"methodName": "string",
"needCompileFileKey": [
"string"
],
"outputConsole": true,
"runMode": true
}'
返回响应
🟢200OK
application/json
Body
data
object (UnitTestReturnDTO)
可选
cmd
string
运行命令
debug
object (DebugConfig)
可选
runId
string
运行id
runMode
boolean
可选
showCmd
string
接口返回运行命令
errors
array[object (ResultError) {3}]
异常信息
errcode
string
异常编码
errmsg
string
异常消息
field
string
可选
status
enum<string>
可选
枚举值:
failuresuccess
timestamp
string <date-time>
可选
示例
{
"data": {
"cmd": "string",
"debug": {
"compile": "string",
"launch": {},
"support": true
},
"runId": "string",
"runMode": true,
"showCmd": "string"
},
"errors": [
{
"errcode": "string",
"errmsg": "string",
"field": "string"
}
],
"status": "failure",
"timestamp": "2019-08-24T14:15:22Z"
}
🟢201Created
🟠401Unauthorized
🟠403Forbidden
🟠404Not Found
修改于 2025-05-23 13:47:39