speakeasy-api/agent-skills/setup-sdk-testing
Claude Code and agent skill by speakeasy-api/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when setting up SDK testing, configuring contract tests, writing Arazzo test workflows, or running integration tests. Triggers on "SDK testing", "test SDK", "contract testing", "Arazzo tests", "integration tests", "speakeasy test", "mock server", "test generation", "ResponseValidationError"
Install
npx vskill@latest install speakeasy-api/agent-skills/setup-sdk-testingSKILL.md
setup-sdk-testing
Set up and run tests for Speakeasy-generated SDKs using contract testing, custom Arazzo workflows, or integration tests against live APIs.
Content Guides
| Topic | Guide | |
|---|---|---|
| Arazzo Reference | content/arazzo-reference.md |
The Arazzo reference provides complete syntax for workflows, steps, success criteria, environment variables, and chaining operations.
When to Use
- Setting up automated testing for a generated SDK
- Enabling contract test generation via
gen.yaml - Writing custom multi-step API workflow tests with Arazzo
- Configuring integration tests against a live API
- Debugging
ResponseValidationErroror test failures - User says: "test SDK", "contract testing", "Arazzo tests", "speakeasy test", "mock server", "test generation"
Inputs
| Input | Required | Description | |
|---|---|---|---|
gen.yaml | Yes | Generation config; contract testing is enabled here | |
| OpenAPI spec | Yes | The API spec the SDK is generated from | |
| Target language | Yes | typescript, python, go, or java (contract test support) | |
.speakeasy/tests.arazzo.yaml | No | Custom Arazzo test definitions | |
| Live API credentials | No | Required only for integration testing |
Outputs
| Output | Location | |
|---|---|---|
| Generated contract tests | tests/ directory in SDK output | |
| Mock server config | Auto-generated alongside contract tests | |
| Arazzo test results | Terminal output from speakeasy test | |
| CI workflow | .github/workflows/ (if integration testing configured) |
Prerequisites
- Speakeasy CLI installed and authenticated (
speakeasy auth login) - A working SDK generation setup (
gen.yaml+ OpenAPI spec) - For integration tests: API credentials as environment variables
Decision Framework
Pick the right testing approach based on what you need:
| Need | Approach | Effort | |
|---|---|---|---|
| Verify SDK types and methods match the API contract | Contract testing | Low (auto-generated) | |
| Test multi-step API workflows (create then verify) | Custom Arazzo tests | Medium | |
| Validate against a live API with real data | Integration testing | High | |
| Catch regressions on every SDK regeneration | Contract testing + CI | Low | |
| Test authentication flows end-to-end | Integration testing | High | |
| Verify chained operations with data dependencies | Custom Arazzo tests | Medium |
Start with contract testing. It is auto-generated and catches the most common issues. Add custom Arazzo tests for workflow coverage, and integration tests only when live API validation is required.
Command
Enable Contract Testing
Add to gen.yaml:
Then regenerate the SDK:
Run Tests
Run via CI
Contract tests run automatically in the Speakeasy GitHub Actions workflow when test generation is enabled. No additional CI configuration is needed for contract tests.
Example
1. Contract Testing (Quick Start)
Enable test generation in gen.yaml:
Regenerate the SDK:
Run the generated tests:
The CLI generates tests from your OpenAPI spec, creates a mock server that returns spec-compliant responses, and validates that the SDK correctly handles requests and responses.
2. Custom Arazzo Tests
Create or edit .speakeasy/tests.arazzo.yaml:
Run the custom tests:
Using Environment Variables in Arazzo Tests
Reference environment variables for sensitive values:
Disabling a Specific Test
Use an overlay to disable a generated test without deleting it:
3. Integration Testing
For live API testing, use the SDK factory pattern:
TypeScript example:
Python example:
GitHub Actions CI for integration tests:
What NOT to Do
- Do NOT skip contract testing and jump straight to integration tests -- contract tests are free and catch most issues
- Do NOT hardcode API keys or secrets in Arazzo test files -- use
$env.VARIABLE_NAMEsyntax - Do NOT modify auto-generated test files directly -- they are overwritten on regeneration; use custom Arazzo tests instead
- Do NOT disable failing contract tests without investigating -- a
ResponseValidationErrorusually means the spec and API are out of sync - Do NOT run integration tests with destructive operations in production -- always use a test/staging environment
- Do NOT assume all languages support contract testing -- currently supported: TypeScript, Python, Go, Java
Troubleshooting
ResponseValidationError in contract tests
The SDK response does not match the OpenAPI spec. Common causes:
- Spec is outdated: Regenerate from the latest API spec
- Missing required fields: Check your spec's
requiredarrays match actual API responses - Type mismatches: Verify
typeandformatfields in schema definitions
Tests pass locally but fail in CI
- Check that all environment variables are set in CI secrets
- Verify the CI runner has network access to mock server ports
- Ensure the Speakeasy CLI version matches between local and CI
speakeasy test command not found
Update the Speakeasy CLI:
Mock server fails to start
- Check for port conflicts on the default mock server port
- Ensure the OpenAPI spec is valid:
speakeasy lint openapi -s spec.yaml - Verify
generateTests: trueis set ingen.yamland the SDK has been regenerated
Custom Arazzo test not running
- Verify the file is at
.speakeasy/tests.arazzo.yaml - Check that
operationIdvalues match those in your OpenAPI spec exactly - Validate YAML syntax -- indentation errors are the most common cause
Integration tests intermittently fail
- Add retry logic for network-dependent tests
- Use unique resource names with timestamps to avoid collisions
- Ensure cleanup runs even on test failure (use
finallyorafterEach)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/setup-sdk-testing/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 4
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 29 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/speakeasy-api/agent-skills/setup-sdk-testing)