Skip to main content
New to Testkube? Unleash the power of cloud native testing in Kubernetes with Testkube. Get Started >

Testkube API (1.0.0)

Download OpenAPI specification:Download

E-mail: [email protected] License: MIT

Testkube provides a Kubernetes-native framework for test definition, execution and results

api

Testkube API operations

Test triggers keymap

Returns a keymap (supported/allowed fields) for the test trigger UI screen

Responses

Response samples

Content type
application/json
{
  • "resources": [
    ],
  • "actions": [
    ],
  • "executions": [
    ],
  • "events": {
    },
  • "conditions": [
    ],
  • "concurrencyPolicies": [
    ]
}

List test triggers

List test triggers from the kubernetes cluster

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

selector
string

Labels to filter by

Responses

Response samples

Content type
[
  • {
    }
]

Create new test trigger

Create new test trigger CRD inside a Kubernetes cluster

Request Body schema:

test trigger body

name
required
string

object name

namespace
string

object kubernetes namespace

object

test trigger labels

resource
required
string (TestTriggerResources)
Enum: "pod" "deployment" "statefulset" "daemonset" "service" "ingress" "event" "configmap"

supported kubernetes resources for test triggers

required
object (TestTriggerSelector)
event
required
string

listen for event for selected resource

object (TestTriggerConditionSpec)
object (TestTriggerProbeSpec)
action
required
string (TestTriggerActions)
Value: "run"

supported actions for test triggers

execution
required
string (TestTriggerExecutions)
Enum: "test" "testsuite"

supported test resources for test triggers

required
object (TestTriggerSelector)
concurrencyPolicy
string (TestTriggerConcurrencyPolicies)
Enum: "allow" "forbid" "replace"

supported concurrency policies for test triggers

Responses

Request samples

Content type
{
  • "name": "name",
  • "namespace": "testkube",
  • "labels": {
    },
  • "resource": "pod",
  • "resourceSelector": {
    },
  • "event": "modified",
  • "conditionSpec": {
    },
  • "probeSpec": {
    },
  • "action": "run",
  • "execution": "test",
  • "testSelector": {
    },
  • "concurrencyPolicy": "allow"
}

Response samples

Content type
{
  • "name": "test1",
  • "namespace": "testkube",
  • "labels": {
    },
  • "resource": "pod",
  • "resourceSelector": {
    },
  • "event": "modified",
  • "conditionSpec": {
    },
  • "probeSpec": {
    },
  • "action": "run",
  • "execution": "test",
  • "testSelector": {
    },
  • "concurrencyPolicy": "allow"
}

Bulk update test triggers

Updates test triggers provided as an array in the request body

Request Body schema: application/json

array of test trigger upsert requests

Array
name
required
string

object name

namespace
string

object kubernetes namespace

object

test trigger labels

resource
required
string (TestTriggerResources)
Enum: "pod" "deployment" "statefulset" "daemonset" "service" "ingress" "event" "configmap"

supported kubernetes resources for test triggers

required
object (TestTriggerSelector)
event
required
string

listen for event for selected resource

object (TestTriggerConditionSpec)
object (TestTriggerProbeSpec)
action
required
string (TestTriggerActions)
Value: "run"

supported actions for test triggers

execution
required
string (TestTriggerExecutions)
Enum: "test" "testsuite"

supported test resources for test triggers

required
object (TestTriggerSelector)
concurrencyPolicy
string (TestTriggerConcurrencyPolicies)
Enum: "allow" "forbid" "replace"

supported concurrency policies for test triggers

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Delete test triggers

Deletes all or labeled test triggers

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

selector
string

Labels to filter by

Responses

Response samples

Content type
application/problem+json
[]

Get test trigger by ID

Get test trigger by ID from CRD in kubernetes cluster

path Parameters
id
required
string

unique id of the object

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

Responses

Response samples

Content type
{
  • "name": "test1",
  • "namespace": "testkube",
  • "labels": {
    },
  • "resource": "pod",
  • "resourceSelector": {
    },
  • "event": "modified",
  • "conditionSpec": {
    },
  • "probeSpec": {
    },
  • "action": "run",
  • "execution": "test",
  • "testSelector": {
    },
  • "concurrencyPolicy": "allow"
}

Update test trigger

Update test trigger

path Parameters
id
required
string

unique id of the object

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

Request Body schema:

test trigger upsert request

name
required
string

object name

namespace
string

object kubernetes namespace

object

test trigger labels

resource
required
string (TestTriggerResources)
Enum: "pod" "deployment" "statefulset" "daemonset" "service" "ingress" "event" "configmap"

supported kubernetes resources for test triggers

required
object (TestTriggerSelector)
event
required
string

listen for event for selected resource

object (TestTriggerConditionSpec)
object (TestTriggerProbeSpec)
action
required
string (TestTriggerActions)
Value: "run"

supported actions for test triggers

execution
required
string (TestTriggerExecutions)
Enum: "test" "testsuite"

supported test resources for test triggers

required
object (TestTriggerSelector)
concurrencyPolicy
string (TestTriggerConcurrencyPolicies)
Enum: "allow" "forbid" "replace"

supported concurrency policies for test triggers

Responses

Request samples

Content type
{
  • "name": "name",
  • "namespace": "testkube",
  • "labels": {
    },
  • "resource": "pod",
  • "resourceSelector": {
    },
  • "event": "modified",
  • "conditionSpec": {
    },
  • "probeSpec": {
    },
  • "action": "run",
  • "execution": "test",
  • "testSelector": {
    },
  • "concurrencyPolicy": "allow"
}

Response samples

Content type
application/json
{
  • "name": "test1",
  • "namespace": "testkube",
  • "labels": {
    },
  • "resource": "pod",
  • "resourceSelector": {
    },
  • "event": "modified",
  • "conditionSpec": {
    },
  • "probeSpec": {
    },
  • "action": "run",
  • "execution": "test",
  • "testSelector": {
    },
  • "concurrencyPolicy": "allow"
}

Delete test trigger

Deletes a test trigger

path Parameters
id
required
string

unique id of the object

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

Responses

Response samples

Content type
application/problem+json
[]

Create new test suite

Create new test suite action

Request Body schema:

test details body

name
required
string

object name

namespace
required
string

object kubernetes namespace

description
string
Array of objects (TestSuiteBatchStep)

Run these batch steps before whole suite

Array of objects (TestSuiteBatchStep)

Batch steps to run

Array of objects (TestSuiteBatchStep)

Run these batch steps after whole suite

object

test suite labels

schedule
string

schedule to run test suite

repeats
integer
Default: 1
created
string <date-time>
object (TestSuiteExecutionRequest)

test suite execution request body

required
object (TestSuiteStatus)

test suite status

readOnly
boolean

if test suite is offline and cannot be executed

Responses

Request samples

Content type
{
  • "name": "name",
  • "namespace": "testkube",
  • "description": "collection of tests",
  • "before": [
    ],
  • "steps": [
    ],
  • "after": [
    ],
  • "labels": {
    },
  • "schedule": "* * * * *",
  • "repeats": 1,
  • "created": "2019-08-24T14:15:22Z",
  • "executionRequest": {
    },
  • "status": {
    },
  • "readOnly": true
}

Response samples

Content type
application/json
{
  • "name": "test-suite1",
  • "namespace": "testkube",
  • "description": "collection of tests",
  • "before": [
    ],
  • "steps": [
    ],
  • "after": [
    ],
  • "labels": {
    },
  • "schedule": "* * * * *",
  • "repeats": 1,
  • "created": "2019-08-24T14:15:22Z",
  • "executionRequest": {
    },
  • "status": {
    },
  • "readOnly": true
}

Get all test suites

Returns array of test suites

query Parameters
selector
string

Labels to filter by

textSearch
string
Default: ""

text to search in name and test name

Responses

Response samples

Content type
[
  • {
    }
]

Delete test suites

Deletes all or labeled test suites

query Parameters
selector
string

Labels to filter by

Responses

Response samples

Content type
application/problem+json
[]

Get test suite by ID

Returns test suite with given name

path Parameters
id
required
string

unique id of the object

Responses

Response samples

Content type
{
  • "name": "test-suite1",
  • "namespace": "testkube",
  • "description": "collection of tests",
  • "before": [
    ],
  • "steps": [
    ],
  • "after": [
    ],
  • "labels": {
    },
  • "schedule": "* * * * *",
  • "repeats": 1,
  • "created": "2019-08-24T14:15:22Z",
  • "executionRequest": {
    },
  • "status": {
    },
  • "readOnly": true
}

Update test suite

Update test based on test suite content or git based data

path Parameters
id
required
string

unique id of the object

Request Body schema:

test suite details body

name
required
string

object name

namespace
string

object kubernetes namespace

description
string
Array of objects (TestSuiteBatchStep)

Run these batch steps before whole suite

Array of objects (TestSuiteBatchStep)

Batch steps to run

Array of objects (TestSuiteBatchStep)

Run these batch steps after whole suite

object

test suite labels

schedule
string

schedule to run test suite

repeats
integer
Default: 1
created
string <date-time>
object (TestSuiteExecutionRequest)

test suite execution request body

required
object (TestSuiteStatus)

test suite status

readOnly
boolean

if test suite is offline and cannot be executed

Responses

Request samples

Content type
{
  • "name": "name",
  • "namespace": "testkube",
  • "description": "collection of tests",
  • "before": [
    ],
  • "steps": [
    ],
  • "after": [
    ],
  • "labels": {
    },
  • "schedule": "* * * * *",
  • "repeats": 1,
  • "created": "2019-08-24T14:15:22Z",
  • "executionRequest": {
    },
  • "status": {
    },
  • "readOnly": true
}

Response samples

Content type
application/json
{
  • "name": "test-suite1",
  • "namespace": "testkube",
  • "description": "collection of tests",
  • "before": [
    ],
  • "steps": [
    ],
  • "after": [
    ],
  • "labels": {
    },
  • "schedule": "* * * * *",
  • "repeats": 1,
  • "created": "2019-08-24T14:15:22Z",
  • "executionRequest": {
    },
  • "status": {
    },
  • "readOnly": true
}

Delete test suite

Deletes a test suite

path Parameters
id
required
string

unique id of the object

Responses

Response samples

Content type
application/problem+json
[]

Get test suite metrics

Gets test suite metrics for given tests executions, with particular execution status and timings

path Parameters
id
required
string

unique id of the object

query Parameters
last
integer
Default: 7

last N days to show

limit
integer
Default: 7

limit records count same as pageSize

Responses

Response samples

Content type
application/json
{
  • "passFailRatio": 50,
  • "executionDurationP50": "7m2.71s",
  • "executionDurationP50ms": 422,
  • "executionDurationP90": "7m2.71s",
  • "executionDurationP90ms": 422,
  • "executionDurationP95": "7m2.71s",
  • "executionDurationP95ms": 422,
  • "executionDurationP99": "7m2.71s",
  • "executionDurationP99ms": 422,
  • "totalExecutions": 2,
  • "failedExecutions": 1,
  • "executions": [
    ]
}

List tests for test suite

List available tests for test suite

path Parameters
id
required
string

unique id of the object

Responses

Response samples

Content type
[
  • {
    }
]

Abort all executions of a test suite

Abort all test executions of a test suite

path Parameters
id
required
string

unique id of the object

Responses

Response samples

Content type
application/problem+json
[]

Get all test suite with executions

Returns array of test suite with executions

query Parameters
selector
string

Labels to filter by

textSearch
string
Default: ""

text to search in name and test name

status
string (TestSuiteExecutionStatus)
Enum: "queued" "running" "passed" "failed" "aborting" "aborted" "timeout"

optional status filter containing multiple values separated by comma

pageSize
integer
Default: 100

the number of executions to get, setting to 0 will return only totals

page
integer
Default: 0

the page index to start at

Responses

Response samples

Content type
[
  • {
    }
]

Get test suite by ID with execution

Returns test suite with given name with execution

path Parameters
id
required
string

unique id of the object

Responses

Response samples

Content type
{
  • "testSuite": {
    },
  • "latestExecution": {
    }
}

Starts new test suite execution

New test suite execution returns new execution details on successful execution start

path Parameters
id
required
string

unique id of the object

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

last
integer
Default: 7

last N days to show

testSuiteExecutionName
string

test suite execution name stated the test suite execution

Request Body schema: application/json

body passed to configure execution

name
string

test execution custom name

number
integer

test suite execution number

namespace
string

test kubernetes namespace ("testkube" when not set)

object (Variables)

execution variables passed to executor converted to vars for usage in tests

object

test suite labels

object

execution labels

sync
boolean

whether to start execution sync or async

httpProxy
string

http proxy for executor containers

httpsProxy
string

https proxy for executor containers

timeout
integer <int32>

duration in seconds the test suite may be active, until its stopped

object (TestContentRequest)

test content request body

object (RunningContext)

running context for test or test suite execution

jobTemplate
string

job template extensions

jobTemplateReference
string

name of the template resource

cronJobTemplate
string

cron job template extensions

cronJobTemplateReference
string

name of the template resource

scraperTemplate
string

scraper template extensions

scraperTemplateReference
string

name of the template resource

pvcTemplate
string

pvc template extensions

pvcTemplateReference
string

name of the template resource

concurrencyLevel
integer <int32>

number of tests run in parallel

testSuiteExecutionName
string

test suite execution name started the test suite execution

Responses

Request samples

Content type
application/json
{
  • "name": "testing with 1000 users",
  • "number": 1,
  • "namespace": "testkube",
  • "variables": {
    },
  • "labels": {
    },
  • "executionLabels": {
    },
  • "sync": true,
  • "httpProxy": "user:[email protected]:8080",
  • "httpsProxy": "user:[email protected]:8081",
  • "timeout": 1,
  • "contentRequest": {
    },
  • "runningContext": {
    },
  • "jobTemplate": "string",
  • "jobTemplateReference": "string",
  • "cronJobTemplate": "string",
  • "cronJobTemplateReference": "string",
  • "scraperTemplate": "string",
  • "scraperTemplateReference": "string",
  • "pvcTemplate": "string",
  • "pvcTemplateReference": "string",
  • "concurrencyLevel": 10,
  • "testSuiteExecutionName": "string"
}

Response samples

Content type
application/json
{
  • "totals": {
    },
  • "filtered": {
    },
  • "results": [
    ]
}

Get all test suite executions

Returns array of all available test suite executions

path Parameters
id
required
string

unique id of the object

query Parameters
pageSize
integer
Default: 100

the number of executions to get, setting to 0 will return only totals

page
integer
Default: 0

the page index to start at

status
string (TestSuiteExecutionStatus)
Enum: "queued" "running" "passed" "failed" "aborting" "aborted" "timeout"

optional status filter containing multiple values separated by comma

startDate
string <date>

startDate for filtering in ISO-8601 format, i.e. "yyyy-mm-dd"

endDate
string <date>

endDate for filtering

Responses

Response samples

Content type
application/json
{
  • "totals": {
    },
  • "filtered": {
    },
  • "results": [
    ]
}

Get test suite execution

Returns test suite execution with given executionID

path Parameters
id
required
string

unique id of the object

executionID
required
string

unique id of the object execution

Responses

Response samples

Content type
application/json
{
  • "id": "62f395e004109209b50edfc1",
  • "name": "test-suite1.needlessly-sweet-imp",
  • "testSuite": {
    },
  • "status": "queued",
  • "envs": {
    },
  • "variables": {
    },
  • "secretUUID": "7934600f-b367-48dd-b981-4353304362fb",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z",
  • "duration": "2m",
  • "durationMs": 6000,
  • "stepResults": [
    ],
  • "executeStepResults": [
    ],
  • "labels": {
    },
  • "runningContext": {
    },
  • "testSuiteExecutionName": "string"
}

Aborts testsuite execution

Aborts testsuite execution with given executionID

path Parameters
id
required
string

unique id of the object

executionID
required
string

unique id of the object execution

Responses

Response samples

Content type
application/problem+json
[]

Get test suite execution artifacts

Returns test suite execution artifacts with given executionID

path Parameters
id
required
string

unique id of the object

executionID
required
string

unique id of the object execution

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "size": 0,
  • "executionName": "test-1",
  • "status": "ready"
}

Starts new test suite executions

New test suite executions returns new executions details on successful executions start

query Parameters
namespace
string
Default: "testkube"

Namespace of the object

selector
string

Labels to filter by

concurrency
integer
Default: 10
Request Body schema: application/json

body passed to configure executions

name
string

test execution custom name

number
integer

test suite execution number

namespace
string

test kubernetes namespace ("testkube" when not set)

object (Variables)

execution variables passed to executor converted to vars for usage in tests

object

test suite labels

object

execution labels

sync
boolean

whether to start execution sync or async

httpProxy
string

http proxy for executor containers

httpsProxy
string

https proxy for executor containers

timeout
integer <int32>

duration in seconds the test suite may be active, until its stopped

object (TestContentRequest)

test content request body

object (RunningContext)

running context for test or test suite execution

jobTemplate
string

job template extensions

jobTemplateReference
string

name of the template resource

cronJobTemplate
string

cron job template extensions

cronJobTemplateReference
string

name of the template resource

scraperTemplate
string

scraper template extensions

scraperTemplateReference
string

name of the template resource

pvcTemplate
string

pvc template extensions

pvcTemplateReference
string

name of the template resource

concurrencyLevel
integer <int32>

number of tests run in parallel

testSuiteExecutionName
string

test suite execution name started the test suite execution

Responses

Request samples

Content type
application/json
{
  • "name": "testing with 1000 users",
  • "number": 1,
  • "namespace": "testkube",
  • "variables": {
    },
  • "labels": {
    },
  • "executionLabels": {
    },
  • "sync": true,
  • "httpProxy": "user:[email protected]:8080",
  • "httpsProxy": "user:[email protected]:8081",
  • "timeout": 1,
  • "contentRequest": {
    },
  • "runningContext": {
    },
  • "jobTemplate": "string",
  • "jobTemplateReference": "string",
  • "cronJobTemplate": "string",
  • "cronJobTemplateReference": "string",
  • "scraperTemplate": "string",
  • "scraperTemplateReference": "string",
  • "pvcTemplate": "string",
  • "pvcTemplateReference": "string",
  • "concurrencyLevel": 10,
  • "testSuiteExecutionName": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

Get all test suite executions

Returns array of test suite executions

query Parameters
last
integer
Default: 7

last N days to show

test
string
Default: ""

test namespaced name to filter

textSearch
string
Default: ""

text to search in name and test name

pageSize
integer
Default: 100

the number of executions to get, setting to 0 will return only totals

page
integer
Default: 0

the page index to start at

status
string (TestSuiteExecutionStatus)
Enum: "queued" "running" "passed" "failed" "aborting" "aborted" "timeout"

optional status filter containing multiple values separated by comma

startDate
string <date>

startDate for filtering in ISO-8601 format, i.e. "yyyy-mm-dd"

endDate
string <date>

endDate for filtering

selector
string

Labels to filter by

Responses

Response samples

Content type
application/json
{
  • "totals": {
    },
  • "filtered": {
    },
  • "results": [
    ]
}

Get test suite execution by ID

Returns test suite execution with given executionID

path Parameters
executionID
required
string

unique id of the object execution

query Parameters
last
integer
Default: 7

last N days to show

Responses

Response samples

Content type
application/json
{
  • "id": "62f395e004109209b50edfc1",
  • "name": "test-suite1.needlessly-sweet-imp",
  • "testSuite": {
    },
  • "status": "queued",
  • "envs": {
    },
  • "variables": {
    },
  • "secretUUID": "7934600f-b367-48dd-b981-4353304362fb",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z",
  • "duration": "2m",
  • "durationMs": 6000,
  • "stepResults": [
    ],
  • "executeStepResults": [
    ],
  • "labels": {
    },
  • "runningContext": {
    },
  • "testSuiteExecutionName": "string"
}

Aborts testsuite execution

Aborts testsuite execution with given executionID

path Parameters
executionID
required
string

unique id of the object execution

Responses