hybrid-cloud-test-gen
Hybrid Cloud Test Generation
This skill generates tests for Sentry's hybrid cloud architecture. It covers RPC services, API gateway proxying, outbox patterns, and endpoint silo decorators.
Critical Constraints
ALWAYS use factory methods (
self.create_user(),self.create_organization()) — neverModel.objects.create().
NEVER wrap factory method calls in
assume_test_silo_modeorassume_test_silo_mode_of. Factories are silo-aware and handle silo mode internally. Only use silo mode context managers for direct ORM queries (Model.objects.get/filter/count/exists/delete).
ALWAYS use
pytest-style assertions (assert x == y) — neverself.assertEqual().
ALWAYS add tests to existing test files rather than creating new ones, unless no file exists for that module.
For cross-silo ORM access: use
assume_test_silo_mode_of(Model)when accessing a single model (auto-detects silo). Useassume_test_silo_mode(SiloMode.X)when the block covers multiple models or non-model operations.
Use
TestCasefor most tests, including those usingoutbox_runner(). Only useTransactionTestCasewhen tests need real committed transactions (threading, concurrency, multi-process scenarios).
NEVER use
from __future__ import annotationsin test files that deal with RPC models.