Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Eclipse Tractus-X SDK TestLab

Eclipse Tractus-X Test Lab

TestLab is the test authoring and execution engine for Eclipse Tractus-X dataspaces. It lets you author, compile, distribute, and execute conformity tests against dataspace connectors and industry services — without writing any Python code.

Test authors write declarative YAML tests describing the steps to execute, the values to check, and the cleanup to perform. TestLab validates them, packages them, runs them against real connectors and services, and records a full execution trace. It builds on the Tractus-X SDK for its dataspace calls.

Key Components

  • TCK — a Test Case Kit: an index.yaml manifest plus the tests it lists, written in the v1-alpha syntax
  • Compiler — validates a TCK before anything runs and seals it into a portable .tck package, optionally signed and encrypted for specific players
  • Player — executes a TCK from the testlab CLI or embedded in your own application (TestlabPlayer), and writes a CloudEvents execution trace
  • Infrastructure bindings — the connectors and registries a run drives are bound by the operator (testlab.config.yaml or TESTLAB_* variables), never named inside a test
  • Server — a FastAPI app (testlab serve) that runs TCKs, streams live execution events over SSE, and serves the callback and mock endpoints tests listen on

How It Works

A test is a sequence of steps from a predefined catalogue — for example connector/provider/create_asset, connector/consumer/pull_data_filtered, digital-twin-registry/consumer/dataplane/lookup_shell — each declaring its inputs under with:, the outputs it publishes under returns:, and the checks on those outputs under validate:. See the Step Reference for every step and the TCK Syntax for the format.

Quick Start

This walkthrough takes about five minutes: install the CLI, write a one-test TCK, and run it. For other installation options, see INSTALL.md.

1. Install the CLI

TestLab needs Python 3.12 or newer. Install it into a virtual environment:

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install --pre tractusx-testlab

This puts the testlab command on your path. Check it works:

testlab --help

2. Write a TCK

A TCK (Test Case Kit) is a directory holding an index.yaml manifest and the tests it lists. Create this layout:

hello-tck/
├── index.yaml
└── tests/
    └── health_check.yaml

hello-tck/index.yaml:

syntax: v1-alpha
kind: tck
id: hello-tck
metadata:
  name: Hello TCK
  version: "1.0"
  description: My first TestLab TCK

tests:
  - id: health_check.yaml
    name: Health check

hello-tck/tests/health_check.yaml:

kind: test
syntax: v1-alpha

namespace: hello-tck
id: health-check

metadata:
  name: Health check
  version: "1.0"

execution:
  - id: health_check
    uses: http/http_request          # a step from the Step Reference
    name: Call the service
    with:
      method: GET
      url: https://eclipse-tractusx.github.io/
    returns:
      status_code:
        type: integer
    validate:
      - uses: validate/assert        # checks read the values declared under returns
        with: { input: status_code, operator: equals, value: 200 }

3. Validate it

cd hello-tck
testlab validate index.yaml
OK — index.yaml is valid (no issues)

A mistake in the YAML is reported here, with the file and line, before anything runs.

4. Run it

testlab run index.yaml

TestLab executes each step, logs every call it makes, and ends with a summary:

╔==============================================================================╗
║                                TCK RUN SUMMARY                               ║
╠==============================================================================╣
║  TEST                                           RESULT      TIME             ║
║  --------------------------------------------------------------------------  ║
║  ✓ Health check                                   PASS      3.5s             ║
╠==============================================================================╣
║  RESULT: PASS  |  1 passed  0 failed  0 skipped  |  Total: 3.5s              ║
╚==============================================================================╝

The console transcript is written to ./logs and the full execution trace — every step's outputs, checks and request/response — to ./data.

5. Package and share it

Compile the TCK into a single .tck package that anyone can run:

testlab compile index.yaml -o hello.tck
testlab run hello.tck

[!TIP]

  • testlab <command> --help lists every option, for example --var KEY=VALUE to override a variable at run time.
  • To sign and encrypt packages for a specific player, see Compiling Packages.

Documentation

The full documentation is published at eclipse-tractusx.github.io/tractusx-testlab. Its sources live in the docs directory.

Contributing

Please refer to the CONTRIBUTING.md file for information on how to contribute to this project.

License

Distributed under the Apache License 2.0. See LICENSE for code and LICENSE_non-code for non-code content.

NOTICE

This work is licensed under the Apache-2.0.

Release files for tractusx-testlab 1.0.0a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tractusx-testlab 1.0.0a3
File Size Uploaded
tractusx_testlab-1.0.0a3.tar.gz 326.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tractusx-testlab 1.0.0a3
File Interpreter ABI Platform
tractusx_testlab-1.0.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 919.8 kB

Release files / tractusx_testlab-1.0.0a3.tar.gz

Download URL tractusx_testlab-1.0.0a3.tar.gz
Size 326.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a123452ae0e6f4334ad9c20d97d1daa14d38409691f3383b21c7c06b594fb488
BLAKE2b-256 checksum
How to use checksums
441bf07b538002b862e40d1f0def601097a8a2c40fa3e29ea0209c60ef03436b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / tractusx_testlab-1.0.0a3-py3-none-any.whl

Download URL tractusx_testlab-1.0.0a3-py3-none-any.whl
Size 593.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8053c87ad56aaecfc8be10cf28816c540fc2ef97d2137a81d217afccc82d695a
BLAKE2b-256 checksum
How to use checksums
939123d491fec3c3fbad19c1700b8e3b09cb63b5b84a70beef5853a3a35d26e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page