Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 2.82 KB

README.md

File metadata and controls

59 lines (44 loc) · 2.82 KB

Buildkite Test Engine Client Examples

This repository contains examples for using the Buildkite Test Engine Client.

Each example directory contains application and test runner configuration. Some directories contain multiple variants. The corresponding Buildkite pipeline steps are in .buildkite/pipeline.yml. Read both when adapting an example because the pipeline configuration determines how test results are uploaded.

Result uploads

Configure one method to upload results from each test run:

  • Built-in bktec upload: The Tests Buildkite plugin enables built-in uploads by default. Do not configure a Buildkite Test Collector to upload the same results. The Go example uses this configuration.
  • Collector upload with bktec: Let the collector upload results and set upload-results: false. bktec can still discover, split, run, and retry the tests. The Ruby, JavaScript, and Python examples use this configuration.
  • Collector upload without bktec: Let the collector upload results, set upload-results: false, and set install-client: false. The Vitest, Swift, and Android examples use this configuration (Vitest OpenTelemetry uses bktec).

Important

If bktec and a Buildkite Test Collector both upload results from the same test run, Test Engine records duplicate test executions.

A Buildkite Test Collector is not a general prerequisite for using bktec. Some examples also demonstrate OpenTelemetry collection. Check the matching pipeline step for the complete configuration.

The versioned JavaScript OpenTelemetry guide defines supported versions, instrumentation, delivery and limitations.

Jest examples

  • jest: collector 1.15.0 with the default JSON uploads and bktec.
  • jest-otel: collector 1.15.0 with OpenTelemetry test results, manual, local HTTP and fetch spans.

Playwright examples

  • playwright: JSON collection with bktec, including pool runs.
  • playwright-otel: collector 1.15.0 with OpenTelemetry test results, nested steps, browser actions and assertions.

Vitest examples

  • vitest-4: Vitest 4.
  • vitest: the current Vitest major version (5).
  • vitest-otel: collector 1.15.0 with OpenTelemetry test results, hook, manual, local HTTP and fetch spans (Vitest 4/5).

The JSON examples run Vitest directly and upload results using the Buildkite Test Collector. They have independent npm installs to keep their Vitest versions isolated. Use the Node version in each example's mise.toml, run npm ci and npm test in that directory, and set BUILDKITE_ANALYTICS_TOKEN to upload.