agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/microservices-testing/SKILL.md

microservices-testing

Skill1 starsChanged 52 days agoMITView on GitHub

Use when designing a test strategy for microservices or distributed systems — service/component tests, consumer-driven contracts, service virtualization, testing in production, sagas and distributed transactions, cross-service E2E minimization, and the test honeycomb.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    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
  1. Distinctive:

    Data ownership: no shared DB; tests must not read other services' tables.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Microservices Testing

Distributed systems shift bugs from inside components to between them. Favor the honeycomb: few unit, many integration/contract, very few E2E.

Layers

LayerScopeTooling
UnitDomain logic in one serviceunit-testing
ComponentOne service, real DB/cache (Testcontainers), stubbed peersWireMock, MockServer, MSW, Testcontainers
ContractConsumer expectations ↔ providerPact, Spring Cloud Contract (contract-testing)
Integration2–3 real services in a compose/k8s namespacedocker compose, kind/k3d, Tilt
E2ECritical user journeys only (≤10)Playwright/Cypress on staging
ProductionCanary, synthetic probes, feature flagsproduction-monitoring-synthetic-testing

Component test recipe

# docker-compose.test.yml
services:
  orders: { build: ., depends_on: [pg, payments-stub] }
  pg: { image: postgres:16 }
  payments-stub: { image: wiremock/wiremock, volumes: ["./stubs:/home/wiremock"] }

Stub not only success: timeouts, 500s, slow responses (fault delay), malformed JSON, connection reset. Assert timeouts, retries with backoff+jitter, circuit-breaker open/half-open, fallback behavior, bulkheads.

Distributed-transaction (saga) testing

Enumerate each step's failure → verify compensation runs, is idempotent, and final state is consistent. Test compensation failing. Test out-of-order and duplicate events. Verify orchestrator restart mid-saga resumes.

Cross-cutting checks

  • API versioning: N and N-1 clients against N provider; deprecate with telemetry.
  • Observability: trace ID propagates across all hops (traceparent); one test asserts a request produces a connected trace (observability-testing).
  • Auth propagation: service-to-service tokens/mTLS; confused-deputy (service acts with user's rights only).
  • Config & secrets: missing env var → fail fast at boot; readiness vs liveness probes.
  • Data ownership: no shared DB; tests must not read other services' tables.
  • Deployment: rolling update with in-flight requests; schema migration backward-compatible (expand/contract).

Anti-patterns

Giant shared staging environment as the only integration test · E2E for every rule · mocking the DB you own · no timeouts in client calls · testing only happy paths between services.

Related

contract-testing, event-driven-messaging-testing, chaos-resilience-testing, integration-testing, cloud-infrastructure-testing

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.