service-virtualization

Select test isolation strategies for external dependencies in CI suites.

2|Updated Apr 18, 2021
One-click install
npx skills add https://github.com/rabbicse/go-projects --skill service-virtualization-rabbicse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: service-virtualization
Source: https://github.com/rabbicse/go-projects/tree/main/projects/movie-ticket-booking/.claude/skills/service-virtualization
Command: npx skills add https://github.com/rabbicse/go-projects --skill service-virtualization-rabbicse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you keep tests fast, reliable, and realistic by isolating external dependencies without letting real network calls or flaky services break CI.

Core Features & Use Cases

  • Strategy selection: Choose between in-process mocks, HTTP stubs, record-replay, fault injection, or ephemeral real services based on the dependency and test level.
  • CI enforcement: Fail the suite when any unhandled real call escapes the virtualization layer, preventing accidental dependency leaks.
  • Realistic coverage: Model success and failure paths such as rate limits, timeouts, connection resets, and contract drift for third-party APIs, databases, caches, and queues.
  • Use case: A team integrating payments, email, and PostgreSQL can use this Skill to decide which dependencies should use MSW, WireMock, Testcontainers, or Toxiproxy and how to validate them in GitHub Actions.

Quick Start

Ask for the best virtualization approach for each external dependency in your test suite and specify that CI must fail on any real call that is not stubbed.

Frequently Asked Questions about service-virtualization

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

FAQPage Schema
How do I choose the right test isolation strategy for external dependencies?

Choosing the right test isolation strategy involves matching in-process mocks, HTTP stubs, record-replay, fault injection, or ephemeral real services to your dependency and test level to keep tests fast and reliable.

How do I block unhandled real network calls in CI pipelines?

To block unhandled real network calls in CI, enforce a virtualization layer that fails the test suite whenever an accidental dependency leak escapes the stubbed environment, preventing flaky services from breaking continuous integration.

When should I use WireMock vs Testcontainers for integration tests?

Use WireMock for HTTP stubs when you need contract-aware record-replay, and use Testcontainers for ephemeral real services when testing dependencies like databases or caches that require realistic behavior in integration tests.

Can I simulate API rate limits and timeouts using service virtualization?

Yes, you can simulate API rate limits, timeouts, and connection resets by applying fault injection tools like Toxiproxy to model realistic failure paths and validate how your application handles third-party API disruptions.

How do I prevent contract drift when using MSW for test isolation?

To prevent contract drift when using MSW for test isolation, apply contract-aware drift protection that validates your stubs against the actual third-party API schema, ensuring your mocks accurately reflect the live service.