testing-strategies

Implements 3-tier testing strategies for Kailash workflows, DataFlow, Nexus, and Kaizen agents.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill testing-strategies-hamza-haadi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing-strategies
Source: https://github.com/Hamza-Haadi/disease-risk-classifier-hamza/tree/main/.claude/skills/12-testing-strategies
Command: npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill testing-strategies-hamza-haadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing AI workflow applications is difficult because mocking hides real integration bugs like database constraint violations, API timeouts, and race conditions. This Skill provides a structured 3-tier testing strategy with a real-infrastructure policy for integration and end-to-end tests. ## Core Features & Use Cases - 3-Tier Test Organization: Separates unit tests (mocking allowed), integration tests (real databases and APIs), and end-to-end tests (full user flows) with clear directory structure and fixture patterns. - Real Infrastructure Policy: Enforces testing against real PostgreSQL/SQLite databases, live HTTP endpoints, and actual LLM calls in Tiers 2-3 instead of mocks. - Runtime Parity Testing: Runs the same tests against both LocalRuntime and AsyncLocalRuntime using shared parametrized fixtures. - Use Case: When building a Kailash workflow that writes to a database via DataFlow, use this Skill to write a Tier 2 integration test that executes the workflow against a real Dockerized PostgreSQL instance and verifies persisted records. ## Quick Start Ask the AI to write a Tier 2 integration test for my Kailash workflow using a real PostgreSQL test database with proper fixture cleanup.

Frequently Asked Questions about testing-strategies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests for Kailash workflows?▼

Write Tier 2 integration tests by building a workflow with WorkflowBuilder and executing it with LocalRuntime against real infrastructure like a Dockerized PostgreSQL database. Use a context manager for the runtime to ensure proper resource cleanup, and never mock databases or SDK components.

What is the 3-tier testing strategy in pytest?▼

The 3-tier strategy splits tests into Tier 1 unit tests (fast, mocking allowed, roughly 70% of tests), Tier 2 integration tests (real databases and APIs, about 25%), and Tier 3 end-to-end tests (full user flows, about 5%). Each tier has its own directory and timeout limits.

Should I mock the database in integration tests?▼

No, the policy forbids mocking databases, HTTP calls, and SDK components in Tiers 2-3 because mocks hide real issues like constraint violations, connection pool exhaustion, and race conditions. Use Docker containers for test databases instead.

How do I test both sync and async Kailash runtimes?▼

Use runtime parity testing with parametrized fixtures from tests/shared/runtime. The runtime_class fixture runs each test against both LocalRuntime and AsyncLocalRuntime, and the execute_runtime helper normalizes parameters and return structures.

How do I test LLM agents without high API costs?▼

Test Kaizen agents as Tier 2 integration tests using real LLM calls combined with response caching to reduce costs. Avoid mocking the LLM provider, since cached real responses still surface actual token limits and error conditions.

What test infrastructure is required for Kailash integration tests?▼

Integration tests require Docker services started via the test-env script: PostgreSQL on port 5433, Redis on 6380, MinIO on 9001, and Elasticsearch on 9201. Run pytest with per-tier timeouts of 1, 5, and 10 seconds.