testing-strategy

Defines testing strategy for the ResoniteIO Python and C# gRPC bridge monorepo.

3|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/MLShukai/ResoniteIO --skill testing-strategy-mlshukai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-strategy
Source: https://github.com/MLShukai/ResoniteIO/tree/main/.agents/skills/testing-strategy
Command: npx skills add https://github.com/MLShukai/ResoniteIO --skill testing-strategy-mlshukai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents low-value tests and drifting mocks in the ResoniteIO monorepo by enforcing a real-resource-first testing policy across Python (pytest) and C# (xUnit) codebases connected over gRPC on Unix Domain Sockets. ## Core Features & Use Cases - Four-tier test classification: unit, integration-with-fakes, integration-real, and e2e/manual, with strict rules on what may be mocked (only self-owned ABCs like ICameraBridge, never grpclib, Kestrel, FrooxEngine, or asyncio internals). - Mirrored test layout: Python tests mirror src/resoio one-to-one and C# tests mirror ResoniteIO.Core, with canonical patterns for Kestrel in-process gRPC round-trips and grpclib UDS servers. - Use Case: Before writing a test for a new Camera modality, consult this Skill to decide the correct tier, build a real UDS round-trip instead of mocking grpclib, and add an e2e scenario driven by just resonite-launch with screenshot verification. ## Quick Start Read this Skill before writing any test, fixing a broken manual scenario, or configuring pytest or xUnit in the ResoniteIO repository.

Frequently Asked Questions about testing-strategy

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

FAQPage Schema
How do I test gRPC services over Unix Domain Sockets?

Stand up a real Kestrel in-process server bound to a temporary UDS path with MapGrpcService, then connect a real grpclib or generated stub client and assert on actual wire behavior. Clean up by stopping the server and deleting the socket file.

What is the rule for mocking in this testing strategy?

Only self-owned abstractions such as ICameraBridge or ILogSink may be faked. Mocking third-party or engine surfaces like grpclib, Kestrel internals, BepInEx, FrooxEngine, asyncio.sleep, or Task.Delay is forbidden; use integration-real tests instead.

How should Python and C# test directories be organized?

Mirror the source tree one-to-one: python/tests/resoio/test_camera.py matches src/resoio/camera.py, and mod/tests/ResoniteIO.Core.Tests mirrors mod/src/ResoniteIO.Core. Shared fakes live in tests/fakes or Common/Fakes.

Can I use a fake clock for timestamp tests?

No. Timestamp correctness is part of the spec, so tests must observe the real UnixNanosClock for monotonicity and nanosecond precision. Use short real awaits with generous margins instead of mocking time.

When are e2e tests with a live Resonite client required?

Every new modality requires an e2e scenario in python/tests/e2e driven by just resonite-launch, with before-and-after screenshots via the in-engine camera to confirm visible state changes. A green unit test suite alone is not considered complete.