Integration Testing
/install integration-testing
Integration Testing with External Services
Quick Start
This skill helps you set up integration tests with external services:
- Testcontainers: Run real services in Docker containers for testing
- WireMock: Mock HTTP services and APIs
- LocalStack: Local AWS services (S3) for testing without AWS dependency
- SFTP: Integration testing with SFTP servers
When to Use This Skill
Use this skill when you need to:
- Set up integration tests with external services
- Test applications against real databases/message queues in isolation
- Mock HTTP APIs for reliable testing
- Test S3 integration without using real AWS resources
- Configure automated integration test environments
Setup Options
Testcontainers Setup
For integration tests with real services:
# Basic testcontainers example
from testcontainers.postgres import PostgresContainer
def test_with_postgres():
with PostgresContainer("postgres:15") as postgres:
connection_string = postgres.get_connection_url()
# Run tests with real PostgreSQL
See testcontainers-guide.md for detailed setup.
WireMock Setup
For mocking HTTP services:
# WireMock configuration example
from wiremock import WireMockServer
def test_with_wiremock():
with WireMockServer() as wiremock:
wiremock.stub_for(
request_method="GET",
request_url="/api/users",
response_body='{"users": []}'
)
# Test against mocked API
See wiremock-patterns.md for common patterns.
LocalStack Setup
For testing S3 without AWS:
# LocalStack S3 testing example
import boto3
from localstack import start_localstack
def test_s3_with_localstack():
with start_localstack(services=["s3"]) as localstack:
s3 = boto3.client('s3', endpoint_url=localstack.endpoint_url)
# Test S3 operations locally
See localstack-s3-config.md for S3 configuration.
SFTP Integration Testing
For testing SFTP connectivity and operations:
# SFTP integration test example
from paramiko import SSHClient
def test_sftp_operations():
with SSHClient() as ssh:
ssh.connect('sftp-server', username='test', password='test')
sftp = ssh.open_sftp()
# Test SFTP file operations
Available Templates
Ready-to-use test templates for common scenarios:
templates/testcontainers-python.py- Python testcontainers setuptemplates/wiremock-http-tests.py- WireMock HTTP API teststemplates/localstack-s33-tests.py- LocalStack S3 integration teststemplates/sftp-integration-tests.py- SFTP integration testing
Helper Scripts
Setup scripts to initialize test environments:
scripts/setup_testcontainers.py- Configure testcontainers environmentscripts/init_wiremock.py- Initialize WireMock serverscripts/start_localstack.py- Start LocalStack services
Best Practices
- Container Management: Always use context managers for container lifecycle
- Port Conflicts: Configure ports to avoid conflicts with local services
- Cleanup: Ensure proper cleanup of resources in test teardown
- Environment Variables: Use env vars for configuration, avoid hardcoded values
- Parallel Testing: Design tests to run in parallel where possible
Getting Help
For detailed setup and patterns, see:
Security & Compliance
This skill is designed SOLELY for legitimate integration testing purposes in isolated development environments.
⚠️ Important Security Notes
- Development Use Only: Never deploy test containers or services to production networks
- Isolated Environments: All services run locally and are destroyed after testing
- Educational Purpose: Designed to teach proper testing methodologies
- Full Transparency: Source code is fully visible and auditable
For detailed security information, see SECURITY.md
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install integration-testing - 安装完成后,直接呼叫该 Skill 的名称或使用
/integration-testing触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Integration Testing 是什么?
Automated integration testing with external services using testcontainers, wiremock, localstack. Use when developer needs to set up integration tests for tes... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 73 次。
如何安装 Integration Testing?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install integration-testing」即可一键安装,无需额外配置。
Integration Testing 是免费的吗?
是的,Integration Testing 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Integration Testing 支持哪些平台?
Integration Testing 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Integration Testing?
由 ahmed181283(@ahmed181283)开发并维护,当前版本 v1.0.1。