Kestra Plugin RunTest

Kestra Plugin RunTest

Certified

Run a single test suite

Executes one unit test suite by namespace and id. Optionally restricts to listed test cases. Failures mark the task as WARNING unless failOnTestFailure is true; errors always fail.

yaml
type: io.kestra.plugin.kestra.ee.tests.RunTest

Run a test

yaml
id: run_test
namespace: company.team

tasks:
  - id: do_run_one_test
    type: io.kestra.plugin.kestra.ee.tests.RunTest
    auth:
      apiToken: "{{ secret('KESTRA_API_TOKEN') }}"
    namespace: company.team
    testId: simple-testsuite

Run a specific test testcase

yaml
id: run_test_single_testcase
namespace: company.team

tasks:
  - id: do_run_one_test
    type: io.kestra.plugin.kestra.ee.tests.RunTest
    auth:
     apiToken: "{{ secret('KESTRA_API_TOKEN') }}"
    namespace: company.team
    testId: simple-testsuite
    testCases:
      - testcase_1
Properties

Namespace containing the test suite

Test suite id

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Select API authentication

Use either an API token or HTTP Basic (username/password); do not provide both.

Definitions
apiTokenstring

API token for bearer auth

autobooleanstring
Defaulttrue

Automatically retrieve credentials from Kestra's configuration if available

The default configuration can be configured globally inside the Kestra configuration file:

  • Set kestra.tasks.sdk.authentication.api-token to use an API token
  • Set kestra.tasks.sdk.authentication.username and kestra.tasks.sdk.authentication.password for HTTP basic authentication
  • Set kestra.tasks.sdk.authentication.url to also default the Kestra API endpoint (see kestraUrl above) The Enterprise edition also provides setting a default configuration at the Namespace or Tenant level by an administrator. Set to false to also opt out of the default URL, and to call a Kestra API that requires no authentication when no credentials are set either.
passwordstring

Password for HTTP Basic auth

usernamestring

Username for HTTP Basic auth

Defaultfalse

Fail task on test failures

Defaults to false. When true, FAILED test cases set the task state to FAILED instead of WARNING.

Override Kestra API endpoint

URL used for calls to the Kestra API. When null, falls back to the url configured alongside the default SDK authentication (Namespace or Tenant level, Enterprise edition), then renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.

Override target tenant

Tenant identifier applied to API calls; defaults to the current execution tenant.

SubTypestring

Test case ids to run

Leave empty to run every test case in the suite.

Test result

Definitions
endDatestring
Formatdate-time
flowIdstring
idstring
namespacestring
resultsarray
assertionResultsarray
actualobject
descriptionstring
errorMessagestring
expectedobject
isSuccessboolean
operatorstring
taskIdstring
errorsarray
detailsstring
messagestring
executionIdstring
fixtures
filesobject
SubTypestring
inputsobject
tasksarray
trigger
statestring
Possible Values
ERRORSUCCESSFAILEDSKIPPEDUNKNOWN_DEFAULT_OPEN_API
testIdstring
testTypestring
urlstring
Formaturi
startDatestring
Formatdate-time
statestring
Possible Values
ERRORSUCCESSFAILEDSKIPPEDUNKNOWN_DEFAULT_OPEN_API
testSuiteIdstring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

Task state override applied based on the test result