service-virtualization

仓库创建 2026年3月24日最近提交 1 个月前SkillHot 收录 2 天前
▸ 精选理由

帮助选择合适的隔离策略并在 CI 中防止真实依赖泄露,适合复杂集成环境。

▸ 风险提示

会使用 Docker/Testcontainers 等组件,需主机支持与额外权限。

这个 Skill 做什么

提供决策框架与实现方案,在测试中隔离或模拟外部依赖并防止真实调用泄露。

给测试里隔离外部依赖提供决策与实现方案,按场景选进程内 mock、HTTP stub(MSW、WireMock)、record‑replay、故障注入(Toxiproxy)或临时真服务(Testcontainers)。在写集成或端到端测试时,用它避免真实 API 被调用或外部波动干扰测试结果。特点是优先在 HTTP 层做 stub,并在 CI 中确保真实调用不泄露,保证测试稳定可复现。

▸ 展开 SKILL.md 英文原文

Decision framework for isolating every external dependency in a test suite: when to use in-process mocks, HTTP stubs (MSW, WireMock), record-replay, fault injection (Toxiproxy), or ephemeral real services (Testcontainers), and how to enforce that no real calls escape in CI. Use when: "mock service," "stub API," "fake service," "WireMock," "MSW," "Toxiproxy," "test isolation," "dependency management," "stub an external API in CI." Not for: consumer-driven contract verification (Pact, broker) — use contract-testing; standing up a full Docker Compose env or seed data — use test-environments; broad resilience/game-day fault campaigns — use chaos-engineering. Related: contract-testing, test-environments, api-testing, test-data-management, chaos-engineering.

开发编程服务虚拟化依赖隔离故障注入通用
47
Stars
10
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/petrkindlmann/qa-skills/main/skills/service-virtualization/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/petrkindlmann/qa-skills/main/skills/service-virtualization/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
<objective>
Mock Stripe at the SDK layer and your tests pass green while production 500s the moment Stripe
changes a response field — because the stub was never tied to a contract. This skill picks the
right isolation strategy per dependency (in-process mock, HTTP stub, record-replay, fault
injection, or ephemeral real service), stubs at the HTTP layer so tests survive SDK upgrades, and
makes the CI run fail when any real call escapes the stubs.
</objective>

## Quick Route

| Situation | Go to |
|-----------|-------|
| Node/browser test hitting an external HTTP API | MSW → `references/msw.md` |
| Polyglot CI, complex matching, or you need a standalone stub server | WireMock → `references/wi
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有