Test Sessions API (a.k.a TIA API)

You can integrate any Testing framework with Sealights to capture Tests Events like Start and End of Test Stage, Tests results, etc using the API described on this page. This API includes getting the list of tests recommended to be skipped by Sealights for Test Optimization (TIA) and forcing a Full-Run on the next execution of a Test Stage.

For your reference, you’ll find a few sample integrations with various Testing frameworks listed on Integrating Test Executions from various Testing Frameworks.

This API requires the Agent token.


Creating Test Session

Create a test session with a specific Labid and test stage, if there is no labId - use BSId instead

Calling this request to create a new test session for the current run

POST /sl-api/v1/test-sessions

Request details

Request body

Parameter
Description
Default value
Is mandatory?

labId

Lab Id

Mandatory

testStage

Test Stage

Mandatory

bsid

Build Session Id

sessionTimeout

Session Timeout (seconds), max timeout 86400 (24 hours)

14,400 (4 hours)

testGroupId

Test group id

Request Samples

POST /sl-api/v1/test-sessions HTTP/1.1
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
{
  "labId": "LabId",
  "testStage": "Unit Tests",
  "bsid": "bsId",
  "sessionTimeout": 10000,
  "testGroupId": "job name"
}

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "testSessionId": "341dc795-71a8-4253-b686-27ff09f04468"
  }
}

Sample Shell command and response

curl -X POST "https://$DOMAIN/sl-api/v1/test-sessions"
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"labId\":\"LabId\",\"testStage\":\"UnitTests\",\"bsid\":\"bsId\",\"sessionTimeout\":10000}"

200 OK
404 NOT_FOUND
500 BAD_REQUEST

Get Exclude Tests v1 (deprecated)

Getting a list of tests that should be excluded

Calling this request to get a list of test names that should be excluded in the current run (by default with test names)

GET /sl-api/v1/test-sessions/{testSessionId}/exclude-tests

You can specify to get only the External Tests IDs (instead of Test Names) to be returned in the response

GET /sl-api/v1/test-sessions/{testSessionId}/exclude-tests?type=externalId

Request details

Request parameters

Parameter
Description
Is mandatory?

testSessionId

Test Session ID

Mandatory

type

enum:

  • name - Default type if not specific.

  • externalId

Request/Response Samples

Request

GET /sl-api/v1/test-sessions/{testSessionId}/exclude-tests
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response

{
  "data":[
    "Test1",
    "Test2"
    ]
}

Sample Shell command and response

curl -X GET "https://$DOMAIN/sl-api/v1/test-sessions/$TESTSESSIONID/exclude-tests" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json"

200 OK
404 NOT_FOUND
500 BAD_REQUEST

Get Exclude Tests v2

Getting a list of tests that should be excluded

Calling this request to get a list of test names that should be excluded in the current run (by default with test names)

GET /sl-api/v2/test-sessions/{testSessionId}/exclude-tests

Request details

Request parameters

Parameter

Description

Is mandatory?

testSessionId

Test Session ID

Mandatory

Request/Response Samples

Request

GET /sl-api/v2/test-sessions/{testSessionId}/exclude-tests
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response

{
  "metadata": { // metadata to help DevOps debug their integration
    "appName": "string", // app name requested.
    "branchName": "string", // branch name requested.
    "buildName": "string", // build name requested.
    "testStage": "string", // test stage requested.
    "testGroupId": "string", // test group id requested.
    "testSelectionEnabled": true, // when true TIA is on the given app/branch/test-stage
    "isFullRun": true, // when true it means that on the given app/branch/test-stage for the build
    "status": "notReady", // represent recommendations status [notReady, noHistory, ready, error, wontBeReady]
    "fullRunReason": "No statistical model available for build" // describe the reason why full run is recommended (Optional, only if isFullRun=true)
  },
  "excludedTests": [ // an array of objects representing the execluded tests.
    {
      "testName": "string"
    }
  ]
}

Sample Shell command and response

curl -X GET "https://$DOMAIN/sl-api/v2/test-sessions/$TESTSESSIONID/exclude-tests" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json"

200 OK
404 NOT_FOUND
500 BAD_REQUEST

Sending Test Events

Sending test events with status

Calling this request for reporting SeaLights test event result.

POST /sl-api/v2/test-sessions/{testSessionId}

This API can be called several times during a session to report tests in bulk.

Request details

Request parameters

Parameter
Description
Is mandatory?

testSessionId

Test Session ID

Mandatory

Request Body

Parameter
Description
Is mandatory?

body

Array of Test run events (even for a single test)

Mandatory

Test run event

name

Test Name

Mandatory

externalId

(Optional) Test ID from the Test Management platform/framework . This identifier must be Unique and a string long up to 48 characters.

start

Starting time of the test (milliseconds since epoch)

Mandatory

end

Ending time of the test (milliseconds since epoch)

Mandatory

status

Test status: passed, failed or skipped

Mandatory

Request Samples

POST /sl-api/v2/test-sessions/{testSessionId}
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
[
  {
    "name": "TestToRun1",
    "start": 1619341754996,
    "end": 1619341754998,
    "status": "passed"
  }
]

HTTP/1.1 200 OK
HTTP/1.1 400 INVALID
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Sample Shell command and response

curl -X POST "https://$DOMAIN/sl-api/v2/test-sessions/$TESTSESSIONID" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "[{\"name\":\"TestToRun1\",\"start\":1619341754996,\"end\":1619341754998,\"status\":\"passed\"}]"

200 OK
400 INVALID
404 NOT_FOUND
500 BAD_REQUEST 

Delete Test Session

Delete test session when sending of test events has been done.

Calling this request will close the test session and update the coverage.

DELETE /sl-api/v1/test-sessions/{testSessionId}

Request details

Request parameters

Parameter
Description
Is mandatory?

testSessionId

Test Session ID

Mandatory

Request Samples

DELETE /sl-api/v1/test-sessions/{testSessionId}
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Sample Shell command and response

curl -X DELETE "https://$DOMAIN/sl-api/v1/test-sessions/$TESTSESSIONID" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" 

200 OK
404 NOT_FOUND
500 BAD_REQUEST

Force “Full-Run” on a Test Stage

This request will schedule a “full run” for the subsequent execution of a specified Test Stage.

PUT /sl-api/v1/tia/apps/{appName}/branches/{branchName}/testStages/{testStage}/full-run

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App to schedule full run for

Mandatory

branchName

Branch to schedule full run for

Mandatory

testStage

Test Stage to schedule full run for

Mandatory

Request Body

Parameter
Description
Is mandatory?

enable

Boolean indicator, indicates if next run will be full run or not

Mandatory

Request Samples

PUT /sl-api/v1/tia/apps/{appName}/branches/{branchName}/testStages/{testStage}/full-run
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
{
    "enable": true
}

HTTP/1.1 200 OK
HTTP/1.1 400 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Sample Shell command and response

curl -X PUT "https://$DOMAIN/sl-api/v1/tia/apps/$APPNAME/branches/$BRANCHNAME/testStages/$TESTSTAGE/full-run" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"enable\":true}"

200 OK
404 NOT_FOUND
500 BAD_REQUEST

Get recommendations for the latest build for a specific app/branch: it returns a list of test names recommended to be run.

/sl-api/v1/tia/apps/{appName}/branches/{branchName}/test-stages/{testStage}/recommendations

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App name

Mandatory

branchName

Branch name

Mandatory

testStage

Test Stage name

Mandatory

Optional parameters
Parameter
Description
Is mandatory?

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

search

Free text to filter the recommednations by

sortBy

Sort recommnedations bym options are:

  • testName

sortDirection

Sort recommendations direction, options are:

  • asc

  • desc

facet

Saved filters according to recommendations` types, options are:

  • all (default)

  • impacted

  • dependent

  • recentlyFailed

  • previouslyRecommendedAndNotExecuted

  • pinned

  • other

Request/Response Samples

Request

/sl-api/v1/tia/apps/{appName}/branches/{branchName}/test-stages/{testStage}/recommendations
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response

{
  "data": {
    "total": 500,
    "next": 50,
    "previous": 0,
    "list": [
      {
        "testName": "it should return ok",
        "testType": "parameterized",
        "numberOfpermutations": 3,
        "reasons": [
          "impacted"
        ],
        "relativeBuild": {
          "bsId": "some-bsid",
          "buildName": "build1",
          "timestamp": 1651545121
        },
        "pinnedBy": "user",
        "pinnedDate": "12/12/2022",
        "pinnedReason": "important test"
      }
    ],
    "metadata": {
      "appName": "app1",
      "branchName": "master",
      "buildName": "build1",
      "buildSessionId": "bsid1",
      "testStage": "Unit Tests"
    }
  }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v1/tia/apps/$APP_NAME/branches/$BRANCH_NAME/test-stages/$TEST_STAGE/recommendations" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK
400 Missing parameters
401 Recommendations not found due to error

Get recommendations for a specific build according to buildSessionId: it will return a list of test names that are recommended to be run for the given build.

/sl-api/v1/tia/builds/{bsId}/test-stages/{testStage}/recommendations

Request details

Request parameters

Parameter
Description
Is mandatory?

bsId

Build session Id

Mandatory

testStage

Test Stage name

Mandatory

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

search

Free text to filter the recommednations by

sortBy

Sort recommnedations bym options are:

  • testName

sortDirection

Sort recommendations direction, options are:

  • asc

  • desc

facet

Saved filters according to recommendations` types, options are:

  • all (default)

  • impacted

  • dependent

  • recentlyFailed

  • previouslyRecommendedAndNotExecuted

  • pinned

  • other

Request Samples

/sl-api/v1/tia/builds/{bsId}/test-stages/{testStage}/recommendations
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "total": 500,
    "next": 50,
    "previous": 0,
    "list": [
      {
        "testName": "it should return ok",
        "testType": "parameterized",
        "numberOfpermutations": 3,
        "reasons": [
          "impacted"
        ],
        "relativeBuild": {
          "bsId": "some-bsid",
          "buildName": "build1",
          "timestamp": 1651545121
        },
        "pinnedBy": "user",
        "pinnedDate": "12/12/2022",
        "pinnedReason": "important test"
      }
    ],
    "metadata": {
      "appName": "app1",
      "branchName": "master",
      "buildName": "build1",
      "buildSessionId": "bsid1",
      "testStage": "Unit Tests"
    }
  }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v1/tia/builds/$BSID/test-stages/$TEST_STAGE/recommendations" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK
400 Missing parameters
401 Recommendations not found due to error

Get recommendations for a specific build according to app/branch/build-name.

Calling this request for getting a list of test names that are recommended to be run for the given build.

/sl-api/v1/tia/apps/{appName}/branches/{branchName}/builds/{buildName}/test-stages/{testStage}/recommendations

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App name

Mandatory

branchName

Branch name

Mandatory

buildName

Build name

Mandatory

testStage

Test Stage name

Mandatory

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

search

Free text to filter the recommednations by

sortBy

Sort recommnedations bym options are:

  • testName

sortDirection

Sort recommendations direction, options are:

  • asc

  • desc

facet

Saved filters according to recommendations` types, options are:

  • all (default)

  • impacted

  • dependent

  • recentlyFailed

  • previouslyRecommendedAndNotExecuted

  • pinned

  • other

Request Samples

/sl-api/v1/tia/apps/{appName}/branches/{branchName}/builds/{buildName}/test-stages/{testStage}/recommendations
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "total": 500,
    "next": 50,
    "previous": 0,
    "list": [
      {
        "testName": "it should return ok",
        "testType": "parameterized",
        "numberOfpermutations": 3,
        "reasons": [
          "impacted"
        ],
        "relativeBuild": {
          "bsId": "some-bsid",
          "buildName": "build1",
          "timestamp": 1651545121
        },
        "pinnedBy": "user",
        "pinnedDate": "12/12/2022",
        "pinnedReason": "important test"
      }
    ],
    "metadata": {
      "appName": "app1",
      "branchName": "master",
      "buildName": "build1",
      "buildSessionId": "bsid1",
      "testStage": "Unit Tests"
    }
  }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v1/tia/apps/$APP_NAME/branches/$BRANCH_NAME/builds/$BUILD_NAME/test-stages/$TEST_STAGE/recommendations" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK
400 Missing parameters
401 Recommendations not found due to error

Get Executions Status List

Calling this request will respond with a status of all executions that are suitable for the request.

GET /sl-api/v1/executions

This API provides you the ability to handle unexpected end of the execution of your tests that may not trigger the graceful closure of the test session to Sealights (via delete Session API call). If the Timeout set at the creation of the execution is not sufficient to ensure automatic closure, you can use this API to list the executions left open and close them one by one gracefully before opening new sessions.

Request details

Request parameters

Parameter
Description
Is mandatory?

bsid

Build session Id

Mandatory

labId

Lab Id

Mandatory

testStage

Test Stage

status

enum:

  • created

  • pendingDelete / deleting

  • ended

Request Samples

GET /sl-api/v1/executions?bsid={bsid}&status={status}&testStage={testStage}
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json

HTTP/1.1 200 OK
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "total": 3,
    "list": [
      {
        "executionId": "executionId1",
        "bsId": "buildSessionId1",
        "labId": "labId1",
        "creationTime": 226978745454,
        "ttl": 3000,
        "testStage": "unit",
        "status": "created"
      }
    ]
  }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v1/executions?bsid=$bsid" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" 

200 OK
500 BAD_REQUEST

Get Test Runs

Get Test Runs by buildSessionId and Test-Stage

Get test runs for a specific build according to the build session ID and test stage.

/sl-api/v2/tests/builds/{bsId}/test-stages/{testStage}/runs

Request details

Request parameters

Parameter
Description
Is mandatory?

bsId

Build session Id

Mandatory

testStage

Test Stage name

Mandatory

testGroupId

Id of the test group

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

Request Samples

/sl-api/v2/tests/builds/{bsId}/test-stages/{testStage}/runs
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
    "data":
    {
        "total": 163,
        "list":
        [
            {
                "executionId": "eId1",
                "testName": "it should return ok",
                "results":
                {
                    "passed": 0,
                    "failed": 0,
                    "skipped": 1,
                    "total": 1
                },
                "testGroupId": "group 1"
            }
        ],
        "metadata":
        {
            "appName": "My app",
            "branchName": "Development",
            "buildName": "21.2",
            "buildSessionId": "45699dbe-b7a9-4b95-98ba-10e9173a1221",
            "testStage": "Acceptance Tests",
            "txId": "APIGW-2c8688c2-6c93-48df-9e21-c15862f4as5f",
            "dateTime": "Tue, 01 Aug 2023 04:53:12 GMT"
        },
        "summary":
        {
            "total": 163,
            "passed": 80,
            "skipped": 94,
            "failed": 0
        }
    }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v2/tests/builds/{bsId}/test-stages/{testStage}/runs" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK

400 Missing parameters

Get Test Runs by app name, branch name, build name and Test Stage

Get test runs for a specific build according to the app name, branch name, build name and test stage.

/sl-api/v2/tests/apps/{appName}/branches/{branchName}/builds/{buildName}/test-stages/{testStage}/runs

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App Name

Mandatory

branchName

Branch Name

Mandatory

buildName

Build Name

Mandatory

testStage

Test Stage name

Mandatory

testGroupId

Id of the test group

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

Request Samples

/sl-api/v2/tests/apps/{appName}/branches/{branchName}/builds/{buildName}/test-stages/{testStage}/runs
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
    "data":
    {
        "total": 163,
        "list":
        [
            {
                "executionId": "eId1",
                "testName": "it should return ok",
                "results":
                {
                    "passed": 0,
                    "failed": 0,
                    "skipped": 1,
                    "total": 1
                },
                "testGroupId": "group 1"
            }
        ],
        "metadata":
        {
            "appName": "My app",
            "branchName": "Development",
            "buildName": "21.2",
            "buildSessionId": "45699dbe-b7a9-4b95-98ba-10e9173a1221",
            "testStage": "Acceptance Tests",
            "txId": "APIGW-2c8688c2-6c93-48df-9e21-c15862f4as5f",
            "dateTime": "Tue, 01 Aug 2023 04:53:12 GMT"
        },
        "summary":
        {
            "total": 163,
            "passed": 80,
            "skipped": 94,
            "failed": 0
        }
    }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN//sl-api/v2/tests/apps/{appName}/branches/{branchName}/builds/{buildName}/test-stages/{testStage}/runs" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK

400 Missing parameters

Get Test Runs by latest build on app name, branch name and Test Stage

Get test runs for a specific build according to the app name, branch name, build name and test stage.

/sl-api/v2/tests/apps/{appName}/branches/{branchName}/testStages/{testStage}/runs

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App Name

Mandatory

branchName

Branch Name

Mandatory

testStage

Test Stage name

Mandatory

testGroupId

Id of the test group

offset

Result offset - used for pagination

limit

Result limit - used for pagination (max limit 100,000 records)

Request Samples

/sl-api/v2/tests/apps/{appName}/branches/{branchName}/testStages/{testStage}/runs
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
    "data":
    {
        "total": 163,
        "list":
        [
            {
                "executionId": "eId1",
                "testName": "it should return ok",
                "results":
                {
                    "passed": 0,
                    "failed": 0,
                    "skipped": 1,
                    "total": 1
                },
                "testGroupId": "group 1"
            }
        ],
        "metadata":
        {
            "appName": "My app",
            "branchName": "Development",
            "buildName": "21.2",
            "buildSessionId": "45699dbe-b7a9-4b95-98ba-10e9173a1221",
            "testStage": "Acceptance Tests",
            "txId": "APIGW-2c8688c2-6c93-48df-9e21-c15862f4as5f",
            "dateTime": "Tue, 01 Aug 2023 04:53:12 GMT"
        },
        "summary":
        {
            "total": 163,
            "passed": 80,
            "skipped": 94,
            "failed": 0
        }
    }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN///sl-api/v2/tests/apps/{appName}/branches/{branchName}/testStages/{testStage}/runs" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK

400 Missing parameters

Recalculation

Get Previous Build to Recalculate

Get a list of previous builds that the TIA can re-calculate against them

/sl-api/v1/builds/{bsId}/test-stages/{testStage}/previous

Request details

Request parameters

Parameter
Description
Is mandatory?

bsId

Build Session Id

Mandatory

testStage

Test stage name

Mandatory

offset

Result offset - Used for pagination

limit

Result limit - Used for pagination (max limit 100,000 records)

branchName

Limit query to a specific branch

Request Sample

/sl-api/v1/builds/{bsId}/test-stages/{testStage}/previous
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "total": 500,
    "next": 50,
    "previous": 0,
    "list": [
      {
        "branchName": "dev-1",
        "buildName": "build-1",
        "bsId": "some-bsid"
      }
    ]
  }
}

Sample Shell command and response:

curl -X GET "https://$DOMAIN/sl-api/v1/builds/$BSID/test-stages/$TEST_STAGE}/previous" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK

400 Missing parameters

Re-calculate Recommendations Based on Baseline BuildSessionId

This specific API is in beta mode. Please contact your Customer Success representative for details.

Re-calculation of recommendations to specific build and test stage

/sl-api/v1/tia/builds/{bsId}/test-stages/{testStage}/recommendations/calculate

Request details

Parameter
Description
Is mandatory?

bsId

Build Session Id

Mandatory

testStage

Test stage name

Mandatory

baselineBsId

Build Session ID against which to recalculate

Mandatory

Request Sample

/sl-api/v1/tia/builds/${bsId}/test-stages/${testStage}/recommendations/calculate?baselineBsId=${baseLineBsID}
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
HTTP/1.1 200 OK
HTTP/1.1 404 NOT_FOUND
HTTP/1.1 500 BAD_REQUEST

Response Sample

{
  "data": {
    "recommendationsUrl": "/sl-api/v1/tia/builds/ff1e8adf-2617-4320-a6ec-aab25b46f15a/test-stages/Unit Tests/recommendations"
  }
}

Sample Shell Command and Response:

curl -X GET "https://$DOMAIN/sl-api/v1/tia/builds/$BSID/test-stages/$TEST_STAGE/recommendations/calculate?baselineBsId=$BASELINE_BSID" \
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \

200 OK

400 Missing parameters

Enable/Disable TIA

Enable/Disable TIA for a given app/branch

POST /sl-api/v1/tia/apps/{appName}/branches/{branchName}/test-stages/{testStage}/test-selection-status

Request details

Request parameters

Parameter
Description
Is mandatory?

appName

App Name

Mandatory

branchName

Branch Name

Mandatory

testStage

Test Stage name

Mandatory

Request body

Parameter
Description
Default value
Is mandatory?

testSelectionStatus

Enable/Disable TIA

Mandatory

Request Samples

POST /sl-api/v1/tia/apps/{appName}/branches/{branchName}/test-stages/{testStage}/test-selection-status HTTP/1.1
Authorization: Bearer {sealights-agent-token}
Content-Type: application/json
{
  "testSelectionStatus": true
}

HTTP/1.1 200 test selection status updated
HTTP/1.1 400 Bad request
HTTP/1.1 500 Server error

Sample Shell command and response

curl -X POST "https://$DOMAIN/sl-api/v1/tia/apps/${appName}/branches/${branchName}/test-stages/${testStage}/test-selection-status"
  -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"testSelectionStatus\": true}"

Last updated

Was this helpful?