testing-strategies

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest.

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 approach with a real-infrastructure policy for integration and end-to-end tests. ## Core Features & Use Cases - 3-Tier Test Strategy: Organizes tests into fast unit tests (mocking allowed), integration tests with real databases and APIs, and end-to-end tests over live HTTP endpoints. - Real Infrastructure Policy: Enforces no mocking of databases, HTTP calls, or LLM providers in Tiers 2-3, using Docker-based PostgreSQL, Redis, and MinIO test services. - Runtime Parity Testing: Runs the same test against both LocalRuntime and AsyncLocalRuntime using shared parametrized fixtures. - Use Case: When building a Kailash data pipeline, use this Skill to write a Tier 2 integration test that executes a workflow against a real PostgreSQL container and verifies records in the actual database. ## Quick Start Ask the AI to write a Tier 2 integration test for my Kailash workflow using a real PostgreSQL test database.

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 Docker PostgreSQL container. Do not mock databases or SDK nodes, and use the runtime context manager for proper resource cleanup.

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

The 3-tier strategy splits tests into Tier 1 unit tests (fast, mocking allowed, about 70% of tests), Tier 2 integration tests (real databases and APIs, about 25%), and Tier 3 end-to-end tests (full user flows over real HTTP, about 5%).

Can I mock the database in Kailash integration tests?▼

No, mocking databases, HTTP calls, or LLM providers is forbidden in Tiers 2-3 because it hides real issues like constraint violations, timeouts, and race conditions. Use Docker-based test databases and cached LLM responses instead.

How do I test both LocalRuntime and AsyncLocalRuntime?▼

Use the shared parametrized fixtures in tests/shared/runtime/ so the same test runs once with LocalRuntime and once with AsyncLocalRuntime. The execute_runtime helper normalizes parameters and return structures between the two runtimes.

How do I set up test infrastructure for Kailash integration tests?▼

Start the Docker test services with the test-env script in tests/utils, which provides PostgreSQL on port 5433, Redis on 6380, MinIO on 9001, and Elasticsearch on 9201. Then run pytest against the integration test directory with appropriate timeouts.

Why are my Kailash tests failing with resource cleanup errors?▼

LocalRuntime requires use as a context manager in the current version, so wrap execution in a with block to guarantee cleanup. Also ensure fixtures truncate test tables and tear down database connections after each test.