testing-strategies

Guide Kailash teams in designing 3-tier unit, integration, and end-to-end tests.

Updated Oct 10, 2025
One-click install
npx skills add https://github.com/FFOO6866/lead2cash --skill testing-strategies-ffoo6866
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-strategies
Source: https://github.com/FFOO6866/lead2cash/tree/main/.claude/skills/12-testing-strategies
Command: npx skills add https://github.com/FFOO6866/lead2cash --skill testing-strategies-ffoo6866

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Eliminates flaky, misleading tests by defining a clear 3-tier testing strategy for Kailash that enforces real-infrastructure testing for integration and end-to-end levels, while keeping unit tests fast and isolated.

Core Features & Use Cases

  • Tier 2/3 Real Infrastructure Policy (No mocking): Integration and E2E tests must use real DB/runtime/HTTP and explicitly block @patch, MagicMock, and unittest.mock.
  • Deterministic Test Organization: Prescribes a directory layout that separates tier1_unit, tier2_integration, and tier3_e2e responsibilities and uses shared fixtures via conftest.py.
  • Regression Design Guardrails: Requires behavioral regression tests that execute the real code path, and forbids “source-grep only” assertions for correctness.
  • Release-Blocking Pipeline Regression: Mandates docs-exact end-to-end regression tests with deterministic output fingerprints for every taught pipeline.
  • Optional Dependency Testing Pattern: Uses pytest.importorskip to skip tests when optional extras (e.g., [hpo], [redis], [vault]) aren’t installed.

Quick Start

Ask for a testing plan that organizes your unit, integration, and end-to-end tests under the real-infrastructure policy for Kailash and explains what must not be mocked at tiers 2 and 3.

Frequently Asked Questions about testing-strategies

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

FAQPage Schema
How do I organize pytest tests for integration and end-to-end testing without mocking?

Organize pytest tests into tier1_unit, tier2_integration, and tier3_e2e directories using shared conftest.py fixtures. Integration and end-to-end tests must use real DB, runtime, and HTTP infrastructure with no mocking.

Why are my integration tests flaky when using MagicMock and @patch?

Flaky integration tests often result from mocking real infrastructure. Enforce a real-infrastructure policy that explicitly blocks @patch, MagicMock, and unittest.mock in tier 2 and tier 3 tests to ensure reliable behavioral validation.

What's the best way to write regression tests for pipeline outputs?

Write deterministic end-to-end regression tests with output fingerprints for every taught pipeline. Regression tests must execute real code paths and use behavioral assertions, forbidding source-grep only checks for correctness validation.

How do I handle optional dependency testing in pytest when extras like redis or vault aren't installed?

Use pytest.importorskip to skip tests automatically when optional extras such as [hpo], [redis], or [vault] are not installed. This pattern prevents false failures while maintaining coverage for available dependencies.

Does this testing strategy apply to DataFlow, Nexus API, and Kaizen Agent workflows?

Yes, the 3-tier testing strategy applies to selecting the right tier for DataFlow, Nexus API, and Kaizen Agent testing. It defines specific coverage rules and regression requirements for each workflow component.

When should I not use mocking in my test suite?

Mocking should not be used in tier 2 integration and tier 3 end-to-end tests. These tiers require real infrastructure including actual databases, runtime environments, and HTTP services to produce deterministic, trustworthy results.