Drift Testing for Openclaw

A powerful API verification tool that catches spec drift and supports Bi-Directional Contract Testing using OpenAPI specifications.

kevinrvaz
v1.0.0
Apr 15, 2026
0
671
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install drift-testing

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install drift-testing using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Drift Testing?

The drift-testing skill is a comprehensive toolset for Openclaw Skills designed to synchronize API implementations with their OpenAPI specifications. It leverages the Drift CLI to perform Bi-Directional Contract Testing (BDCT), ensuring that your provider implementation accurately reflects the documented contract. This skill is critical for developers who need to maintain API conformance, prevent breaking changes, and automate provider verification within CI/CD pipelines.

Beyond simple validation, this skill provides a full lifecycle for API testing, including coverage analysis, automated feedback loops, and Lua-based scripting for complex state management. Whether you are testing against a live production environment or a local Prism mock server, this Openclaw Skills utility ensures your endpoints are fully covered and compliant with your defined standards.

Drift Testing Use Cases

  • Verifying that an API implementation matches its OpenAPI specification to prevent spec drift.
  • Implementing Bi-Directional Contract Testing (BDCT) within a PactFlow ecosystem.
  • Automatically generating test skeletons and scaffolds from an existing OpenAPI document.
  • Ensuring full endpoint coverage by identifying missing test cases for specific response codes.
  • Debugging API failures using an automated retry loop that runs until all tests pass.

How Drift Testing Works

  1. The skill analyzes the provided OpenAPI specification to identify all available operations, methods, and response codes.
  2. Users initialize the environment using the drift init command to scaffold configuration, datasets, and hook files.
  3. Test cases are authored in YAML, mapping specific operations to expected status codes and parameters.
  4. The Drift CLI executes the tests against a target server URL or a local mock server.
  5. Coverage scripts compare executed tests against the spec to report gaps in endpoint or response code verification.
  6. A feedback loop (run_loop.sh) can be used to iterate on failed tests and missing coverage until the API is fully verified.

Drift Testing Setup

You can use the Drift CLI via npx or install it locally for your project.

# Use via npx without installation
npx @pactflow/drift --help

# Local installation for development teams
npm install --save-dev @pactflow/drift

# Initialize a new Drift project
drift init

Drift Testing Data Schema & Taxonomy

The skill organizes its configuration and test data into a specific directory structure for Openclaw Skills users:

File Purpose
drift.yaml Main configuration file defining sources, plugins, and global auth settings.
drift.lua Lua script containing lifecycle hooks (e.g., operation:started) and helper functions.
*.dataset.yaml Externalized test data and variables used in test expressions.
*.tests.yaml The primary test suite containing operation targets and expected responses.

Drift Testing Advanced Features

  • Lua Lifecycle Hooks: Script complex behaviors for http:request, operation:started, and operation:finished to manage state or seed data.
  • Bi-Directional Contract Testing: Publish results to PactFlow to maintain contract integrity across distributed systems.
  • Automated Coverage Analysis: Use integrated Python scripts to diff your test suite against the OpenAPI spec for 100% verification.
  • Mock Server Integration: Built-in support for Prism mock servers to test API logic without a live backend.
  • Parallel Execution: Optimize CI/CD runtimes by executing test suites in parallel using native CLI flags.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*