agentleFS
terrene-foundationterrene-foundation/pact/.claude/skills/12-testing-strategies/SKILL.md

testing-strategies

Skill0 starsChanged 8 months agoApache-2.0View on GitHub

Comprehensive testing strategies for Kailash applications including the 3-tier testing approach with Real infrastructure recommended policy for Tiers 2-3. Use when asking about 'testing', 'test strategy', '3-tier testing', 'unit tests', 'integration tests', 'end-to-end tests', 'testing workflows', 'testing DataFlow', 'testing Nexus', 'Real infrastructure recommended', 'real infrastructure', 'test organization', or 'testing best practices'.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    What to use instead: Test databases (Docker containers), test API endpoints, test LLM accounts (with caching), temp directories.

    line 26
  2. Distinctive:

    Run Tier 1 in CI always; Tier 2-3 optionally

    line 70
  3. Distinctive:

    Never commit test credentials

    line 71

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kailash Testing Strategies

3-tier testing strategy with real infrastructure policy for Kailash applications.

Sub-File Index

  • test-3tier-strategy - Complete 3-tier guide: tier definitions, fixture patterns, CI/CD integration

3-Tier Strategy

TierScopeMockingSpeedInfrastructure
1 - UnitFunctions, classesAllowed<1s/testNone
2 - IntegrationWorkflows, DB, APIsReal infra recommended1-10s/testReal DB, real runtime
3 - E2EComplete user flowsReal infra recommended10s+/testReal HTTP, real everything

Real Infrastructure Policy (Tiers 2-3)

Why: Mocking hides database constraints, API timeouts, race conditions, connection pool exhaustion, schema migration issues, and LLM token limits.

What to use instead: Test databases (Docker containers), test API endpoints, test LLM accounts (with caching), temp directories.

Key Fixtures

@pytest.fixture
def db():
    """Real database for testing."""
    db = DataFlow("postgresql://test:test@localhost:5433/test_db")
    db.create_tables()
    yield db
    db.drop_tables()

@pytest.fixture
def runtime():
    return LocalRuntime()

Test Organization

tests/
  unit/          # Mocking allowed
  integration/   # Real infrastructure
  e2e/           # Full system
  conftest.py          # Shared fixtures

Component Testing Summary

ComponentTierKey Point
Workflows2Real runtime execution, verify results["node"]["result"]
DataFlow2Real DB, verify with read-back after write
Nexus API3Real HTTP requests to running server
Kaizen Agents2Real LLM calls with response caching

Critical Rules

  • Tier 1: Mock external dependencies
  • Tier 2-3: Real infrastructure, no @patch/MagicMock/unittest.mock
  • Docker for test databases
  • Clean up resources after every test
  • Cache LLM responses for cost control
  • Run Tier 1 in CI always; Tier 2-3 optionally
  • Never commit test credentials

Running Tests

pytest tests/unit/        # Fast CI
pytest tests/integration/ # With real infra
pytest tests/e2e/         # Full system
pytest --cov=app --cov-report=html  # Coverage

Related Skills

  • 07-development-guides - Testing patterns
  • 17-gold-standards - Testing best practices
  • 02-dataflow - DataFlow testing
  • 03-nexus - API testing

Support

  • testing-specialist - Testing strategies and patterns
  • tdd-implementer - Test-driven development
  • dataflow-specialist - DataFlow testing patterns

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.