Tekton
Tekton is a Kubernetes-native CI/CD framework. The Allure TestOps integration uses allurectl and Tekton parameters to connect a PipelineRun to a TestOps launch and optionally let TestOps trigger new pipeline runs via the Tekton dashboard.
One job in Allure TestOps corresponds to one Tekton Pipeline. One launch corresponds to one PipelineRun.
The YAML examples below are intentionally simplified. Adapt the image, workspace, security context, and parameter strategy to your cluster's policies.
Before you begin
- Permission to create and edit Tekton
Task,Pipeline, andPipelineRunresources. - The URL of the TestOps instance and the numeric TestOps project ID.
- A TestOps API token for the upload path.
- The Tekton dashboard URL if you want TestOps-triggered runs.
1. Send results from Tekton to TestOps
Create the TestOps token
- In Allure TestOps, click your avatar and open API Tokens.
- Click + Token.
- Enter a name for the token, for example
Token for Tekton, and click Create. - Copy the generated token.
Create the Task
Create a file named allure-example-test-task.yaml with the Tekton Task that downloads allurectl, runs the tests with allurectl watch, and receives the required environment variables.
The minimum required variables are ALLURE_ENDPOINT, ALLURE_TOKEN, ALLURE_PROJECT_ID, ALLURE_RESULTS, ALLURE_CI_TYPE, and ALLURE_JOB_RUN_ID. The remaining variables are optional but provide richer links and context in TestOps.
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: allure-example-test
spec:
params:
- name: ALLURE_JOB_RUN_ID
type: string
- name: namespace
type: string
- name: pipelineName
type: string
- name: pipelineRunName
type: string
steps:
- name: test
image: gradle:jdk8
script: |
git clone https://github.com/reponame/allure-example.git && cd allure-example
wget -q -O ./allurectl https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_linux_amd64 && chmod +x ./allurectl
./allurectl watch -- ./gradlew clean test
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
env:
- name: ALLURE_ENDPOINT
value: "https://testops.example.com"
- name: ALLURE_TOKEN
value: "$(params.allureToken)"
- name: ALLURE_PROJECT_ID
value: "1"
- name: ALLURE_RESULTS
value: "build/allure-results"
- name: ALLURE_CI_TYPE
value: "tekton"
- name: ALLURE_LAUNCH_NAME
value: "$(params.pipelineName) - $(params.pipelineRunName)"
- name: ALLURE_JOB_URL
value: "https://tekton.example.com/#/namespaces/$(params.namespace)/pipelines/$(params.pipelineName)"
- name: ALLURE_JOB_UID
value: "$(params.namespace)/$(params.pipelineName)"
- name: ALLURE_JOB_NAME
value: "$(params.pipelineName)"
- name: ALLURE_JOB_RUN_ID
value: "$(params.ALLURE_JOB_RUN_ID)"
- name: ALLURE_JOB_RUN_URL
value: "https://tekton.example.com/#/namespaces/$(params.namespace)/pipelineruns/$(params.pipelineRunName)"
- name: ALLURE_JOB_RUN_UID
value: "$(params.pipelineRunName)"
- name: ALLURE_JOB_RUN_NAME
value: "$(params.pipelineRunName)"
- name: ALLURE_TESTPLAN_PATH
value: "./testplan.json"
Environment variable reference:
| Variable | Required | Description |
|---|---|---|
ALLURE_ENDPOINT |
Yes | TestOps instance URL with protocol |
ALLURE_TOKEN |
Yes | TestOps API token |
ALLURE_PROJECT_ID |
Yes | Numeric TestOps project ID |
ALLURE_RESULTS |
Yes | Path to the Allure results directory |
ALLURE_CI_TYPE |
Yes | Always tekton |
ALLURE_JOB_RUN_ID |
Yes | Passed from the Pipeline; links the run to the correct TestOps launch |
ALLURE_LAUNCH_NAME |
No | Launch name template |
ALLURE_JOB_URL |
No | URL of the Pipeline in the Tekton dashboard |
ALLURE_JOB_UID |
No | Stable unique identifier for the Pipeline (e.g. namespace/pipelineName) |
ALLURE_JOB_NAME |
No | Pipeline name |
ALLURE_JOB_RUN_URL |
No | URL of the PipelineRun in the Tekton dashboard |
ALLURE_JOB_RUN_UID |
No | Stable unique identifier for the PipelineRun |
ALLURE_JOB_RUN_NAME |
No | PipelineRun name |
ALLURE_TESTPLAN_PATH |
No | Path to the test plan file; required for selective execution |
Apply the Task:
kubectl apply -f allure-example-test-task.yaml
Create the Pipeline
Create a file named allure-example-pipeline.yaml. The Pipeline declares ALLURE_JOB_RUN_ID as a parameter with an empty default and passes it down to the Task:
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: allure-example
spec:
params:
- description: Allure Job Run ID
name: ALLURE_JOB_RUN_ID
type: string
default: ""
tasks:
- name: test
taskRef:
name: allure-example-test
params:
- name: ALLURE_JOB_RUN_ID
value: "$(params.ALLURE_JOB_RUN_ID)"
- name: pipelineName
value: "$(context.pipeline.name)"
- name: pipelineRunName
value: "$(context.pipelineRun.name)"
- name: namespace
value: "$(context.pipelineRun.namespace)"
Apply the Pipeline:
kubectl apply -f allure-example-pipeline.yaml
Create and run a PipelineRun
Create a file named allure-example-pipelinerun.yaml:
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: allure-example-run-
namespace: tekton-pipelines
spec:
pipelineRef:
name: allure-example
params:
- name: ALLURE_JOB_RUN_ID
value: ""
serviceAccountName: default
podTemplate:
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
Submit the PipelineRun:
kubectl create -f allure-example-pipelinerun.yaml
Check running pipeline executions:
kubectl get pipelineruns -n tekton-pipelines
Clean up historical pipeline runs:
kubectl delete pipelineruns --all -n tekton-pipelines
Verify the upload
After the PipelineRun completes, open TestOps and confirm that a launch was created with results. Open one result and confirm it links back to the PipelineRun URL.
2. Let TestOps trigger Tekton pipelines
This path requires the Tekton dashboard to be deployed and reachable from the TestOps instance. Complete the upload path and run the pipeline at least once before enabling the trigger path — TestOps needs the first upload to create the job automatically.
Add the global Tekton integration
An instance administrator should:
- Open Administration → Integrations.
- Click + Add integration.
- Select Tekton.
- Fill in the fields:
- Name — a recognizable name, for example the dashboard hostname.
- Endpoint — the base URL of the Tekton dashboard, for example
https://tekton.example.com.
- Click Add integration.
Add the Tekton integration to the TestOps project
- In TestOps, open the target project and go to Settings → Integrations.
- Under Available integrations, find the Tekton integration and click Add integration.
- Click Test connection.
- Click Add integration to save.
Triggering pipelines via the Tekton dashboard does not require authentication. Leave the token field blank unless your deployment requires one.
Configure the Tekton-backed job in TestOps
- Open Jobs in the project.
- Click
⋯next to the job created from the first upload and select Configure. - Fill in the fields:
- Name — a stable display name.
- Build server — the global Tekton integration added by the administrator.
- Job can be used to run tests — enable to allow triggering from TestOps.
- Click Submit.
Keep the pipeline name stable. Tekton does not use automatic pipeline discovery, so renaming the pipeline breaks the job identity in TestOps.
3. Pass parameters and branch values
If the Pipeline accepts runtime parameters (namespace, browser, target environment):
- Declare them in the
Pipelineand pass them to the Task as environment variables. - Create the matching names in Administration → Environment.
- Map them in the project under Settings → Environment.
- Configure the job and add the same parameters in the Parameters section.
If the Tekton flow selects a branch or revision, map that control to the special Branch environment variable in TestOps.
Troubleshooting
TestOps receives results but the Tekton run is not linked
ALLURE_JOB_RUN_ID or related job metadata variables are missing from the task environment. Check the parameter pass-through from PipelineRun → Pipeline → Task.
TestOps cannot trigger the Tekton pipeline
Check:
- the Tekton dashboard is reachable from the TestOps instance;
- the project-level integration uses the correct authentication mode;
- the TestOps job points at the correct Tekton integration and pipeline identity.