Skip to main content
Automate your agent testing with the Cekura Bitbucket pipe. This guide shows you how to run Cekura scenarios on every pull request, on merges to a branch, or on demand, and fail the pipeline when a run fails. The pipe starts a Cekura test run, waits for it to finish, and reports the result in the step log, the pipeline Tests tab, a report on the pull request, and downloadable artifacts, with a shareable link to the full result in Cekura.

Before You Get Started

You need:
  • A Cekura API key
  • An agent and scenarios configured in the Cekura dashboard
  • A project ID only when selecting scenarios by evaluator folder
The agent ID is optional. If you omit it, Cekura infers the agent from the selected scenarios.
Bitbucket requires two-step verification on your Bitbucket account before Pipelines can be enabled in a new workspace. Enable it under Personal Bitbucket settings → Two-step verification. The verification on your Atlassian account does not count.

Choose Which Scenarios to Run

Choose a selector: scenario IDs, tags, or an evaluator folder. IDs and tags can be combined; a folder cannot be combined with either.
Run an exact set of scenarios using comma-separated IDs:

Run the Pipeline

1

Add Your API Key

In your Bitbucket repository, go to Repository settings → Pipelines → Repository variables.Set the name to CEKURA_API_KEY, paste your Cekura API key as the value, and tick Secured so Bitbucket masks it in logs.To share one key across several repositories, a workspace admin can add it under Workspace settings → Pipelines → Workspace variables instead.
Never put your API key directly in bitbucket-pipelines.yml.
2

Add the Pipeline Configuration

Create or edit bitbucket-pipelines.yml at the root of your repository:
Replace the selector with one from Choose Which Scenarios to Run. The artifacts block is optional; it keeps the report files for download and for later steps.
3

Start a Test Run

Commit and push the file, then open a pull request. The pipeline starts automatically. If Pipelines is not enabled yet, go to Repository settings → Pipelines → Settings and select Enable Pipelines.You can also start it by hand from Pipelines → Run pipeline.
4

Review the Results

Open the step to see the run start, a status line every 15 seconds, and the result summary with pass and fail counts, failure reasons, and a shareable link to the full result in Cekura.
  • The step is green when every run passed and red when any run failed or the run timed out.
  • The Tests tab lists each failed scenario with the evaluator’s explanation. It appears only when at least one run failed.
  • The pull request shows a Cekura agent tests report with the pass rate and a link to the result. No extra setup is needed.
  • The Artifacts tab holds the summary, details, and JUnit files for 14 days.

Configure Pipeline Triggers

Place the step under the trigger you want. Bitbucket supports several in the same file.
A custom pipeline shows a form when you start it from Pipelines → Run pipeline:
Define a custom pipeline as above, then create a schedule under Pipelines → Schedules that runs it hourly, daily, or weekly on the branch you choose.
For more on triggers, see the Bitbucket Pipelines documentation.

Block Merges on Failed Tests

Go to Repository settings → Branch restrictions, edit the rule for your target branch, and enable Minimum number of successful builds for the last commit with a value of 1. A red Cekura step then prevents the merge.

Use the Result in Another Step

The pipe writes cekura_output.env with RESULT_ID, RESULT_URL, CEKURA_STATUS, CEKURA_FAILED_RUNS, and CEKURA_SUCCESS_RATE. Keep it as an artifact and source it in a later step:

Pipe Variables

Only CEKURA_API_KEY and a scenario selector are needed for a typical run. Empty variables are not sent to Cekura, so the API applies its defaults. *Provide at least one of SCENARIO_IDS, TAGS, or FOLDER_PATH. A folder cannot be combined with IDs or tags.
Bitbucket stops a step after 120 minutes by default. If you raise TIMEOUT above 6000 seconds, also set max-time on the step, up to 720 minutes.

Troubleshooting

Bitbucket asks for two-step verification on new workspaces. Enable it under Personal Bitbucket settings → Security → Two-step verification, then confirm the email Bitbucket sends. Two-step verification set on the Atlassian account alone is not enough.
The API key was rejected. Check that CEKURA_API_KEY is spelled the same in the pipeline file and in Repository variables, and that the variable is set in the repository or workspace the pipeline runs in.
The pipe validates its inputs first. Read the first error line in the step log: it names the variable to fix, for example a folder combined with tags, a non-numeric ID, or a missing PROJECT_ID.
Self-hosted runners need outbound HTTPS to public.ecr.aws to fetch the pipe image and to api.cekura.ai to start the run.
Open the step log for failure reasons and individual failed-run details, or the Tests tab for the failed scenarios. Follow the View results link for transcripts, evaluations, and the AI-generated analysis.