Zadig 文档
Zadig
教程
博客
论坛
关于
中文英文
Zadig
教程
博客
论坛
关于
Zadig v5.0
Loading...
     编辑文档
     反馈问题
     社区讨论

    本页导航

    Test

    # Execute Test Task

    Request

    POST /openapi/quality/testing/task
    
    1

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    project_keyProject KeystringYes
    test_nameTest NamestringYes
    repo_infoRuntime repository configuration; defaults to the test configuration when omitted[]RepoInfoNo
    inputsRuntime inputs; unspecified inputs use values from the test configuration[]InputNo

    RepoInfo Parameter Description

    Parameter NameDescriptionTypeRequired
    codehost_nameCode host namestringYes
    repo_namespaceRepository namespace (organization/user)stringYes
    repo_nameRepository namestringYes
    branchBranch name; required when enable_commit is falsestringNo
    prPull Request numberintNo
    prsPull Request number list[]intNo
    enable_commitWhether to use a specified commitboolNo
    commit_idCommit ID; required when enable_commit is truestringNo

    Repositories in repo_info must already be configured in the test. Perforce repository overrides are not supported.

    Input Parameter Description

    Parameter NameDescriptionTypeRequired
    keyInput name; must already be configured in the teststringYes
    valueInput valuestringNo
    typeInput typestringNo
    is_credentialWhether the input is sensitiveboolNo
    file_idFile IDstringNo
    file_nameFile namestringNo
    file_pathFile pathstringNo

    Body Parameter Example

    {
        "project_key": "demo",
        "test_name": "test-demo",
        "repo_info": [
            {
                "codehost_name": "github",
                "repo_namespace": "koderover",
                "repo_name": "zadig",
                "branch": "main"
            }
        ],
        "inputs": [
            {
                "key": "ENV",
                "value": "test"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    Success Response

    Parameter NameTypeDescription
    task_idintTest Task ID
    {
      "task_id": 27
    }
    
    1
    2
    3

    Failure Response

    {
        "code": 500,
        "description": "mongo: no documents in result",
        "message": "Internal Error: "
    }
    
    1
    2
    3
    4
    5

    # Get Test Variables

    Returns the runtime input definitions for a test. The value of a credential input is not returned; use has_value to determine whether a value is configured.

    Request

    GET /openapi/quality/testing/:testName?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    testNamestringTest NameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Success Response Description

    Parameter NameTypeDescription
    project_keystringProject Key
    test_namestringTest Name
    inputs[]TestInputRuntime input definitions

    TestInput Parameter Description

    Parameter NameTypeDescription
    keystringInput name
    valuestringDefault value; omitted for credential inputs
    typestringInput type
    choice_option[]stringAvailable choices
    requiredboolWhether the input is required
    is_credentialboolWhether the input contains sensitive information
    has_valueboolWhether a value is configured
    descriptionstringInput description

    Success Response Example

    {
        "project_key": "demo",
        "test_name": "test-demo",
        "inputs": [
            {
                "key": "ENV",
                "value": "test",
                "type": "choice",
                "choice_option": [
                    "test",
                    "production"
                ],
                "required": true,
                "is_credential": false,
                "has_value": true,
                "description": "Runtime environment"
            },
            {
                "key": "PASSWORD",
                "type": "string",
                "required": true,
                "is_credential": true,
                "has_value": true
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26

    # Get Test Task Details

    Request

    GET /openapi/quality/testing/:testName/task/:taskID?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    testNamestringTest NameYes
    taskIDintTest Task IDYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Success Response Description

    Parameter NameTypeDescription
    test_nameTest Namestring
    task_idTest Task IDint
    creatorCreatorstring
    create_timeCreation Timeint
    start_timeTask Start Execution Timeint
    end_timeTask End Execution Timeint
    statusCurrent Status:
    created:Test task created
    running:Test task executing
    passed:Test task passed
    skipped:Test task skipped
    failed:Test task failed
    timeout:Test task timeout
    cancelled:Test task cancelled
    waiting:Test task waiting
    queued:Test task queued
    string
    test_reportTest ReportReport

    Report Parameter Description

    Parameter NameTypeDescription
    test_totalTotal test casesint
    failure_totalFailed test casesint
    success_totalSuccessful test casesint
    skiped_totalSkipped test casesint
    error_totalError test casesint
    test_casesTest case list[]TestCase

    TestCase Parameter Description

    Parameter NameTypeDescription
    nameCase namestring
    timeDuration (seconds)int
    failureFailure infoMessage
    skippedSkip infoEmpty struct, null value means this test case was executed, otherwise returns empty struct
    errorError infoMessage

    Message Parameter Description

    Parameter NameTypeDescription
    messageError message summarystring
    typeTypestring
    textError detailsstring

    Success Response Example

    {
        "test_name": "test-demo",
        "task_id": 16,
        "creator": "cici",
        "create_time": 1689823467,
        "start_time": 1689823470,
        "end_time": 1689823491,
        "status": "passed",
        "test_report": {
            "test_total": 24,
            "failure_total": 0,
            "success_total": 24,
            "skiped_total": 0,
            "error_total": 0,
            "time": 13.872,
            "test_type": "",
            "name": "",
            "test_cases": [
                {
                    "name": "e2e Test Suites Scenario 1 - Regression testing of existing projects There is a project called voting in the test environment Can view environment",
                    "time": 0.155922912,
                    "failure": null,
                    "skipped": null,
                    "error": null
                },
                
                {
                    "name": "e2e Test Suites Scenario 1 - Regression testing of existing projects There is a project called voting in the test environment Can view Voting project information",
                    "time": 0.136967508,
                    "failure": null,
                    "skipped": null,
                    "error": null
                },
                {
                    "name": "e2e Test Suites Scenario 2 - Core onboarding process Through the system onboarding process, environments and some workflows are automatically generated Successfully automatically created environments and workflows, workflows can be triggered",
                    "time": 7.83081332,
                    "failure": null,
                    "skipped": null,
                    "error": null
                }
            ]
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43

    Failure Response

    {
        "code": 500,
        "description": "failed to get pipeline task from db, taskID:1, pipelineName:tt-job, err: mongo: no documents in result",
        "message": "Internal Error: "
    }
    
    1
    2
    3
    4
    5

    ← BuildCode Scanning→

    资源
    教程
    论坛
    博客
    公司
    关于
    客户故事
    加入我们
    联系我们
    微信扫一扫
    hello@koderover.com

    © 2026 筑栈(上海)信息技术有限公司 沪 ICP 备 19000177 号 - 1

    •  跟随系统
    •  浅色模式
    •  深色模式
    •  阅读模式