temporal-python-testing skill
✓ 検証済みpytestを使用して、ユニットテスト、統合テスト、タイムスキッピング、リプレイテストの戦略を用いたTemporalワークフローのテストを行います。
- GitHubスター
- 42,413
- ファイル
- 5
- 最終コミット
- 2026年11月9日
- ライセンス
- MIT
- 許可されたツール
- —
temporal-python-testing skillは何をしますか
temporal-python-testingはAgent Skillsです。 pytestを使用して、ユニットテスト、統合テスト、タイムスキッピング、リプレイテストの戦略を用いたTemporalワークフローのテストを行います。.
skillのSKILL.mdから生成された要約。
temporal-python-testing skill について
このSKILLは、分散システムを構築する開発者がpytestを使用してTemporalワークフローをテストすることを可能にします。ワークフローの決定論を保証するために、ユニットテスト、統合テスト、およびリプレイテストのための具体的な戦略を提供します。新しいワークフローのテスト実装、失敗のデバッグ、またはDocker Composeを使用したローカル開発環境のセットアップを行う際に、エージェントはこのSKILLをロードする必要があります。
このSKILLは、unit-testing.mdやintegration-testing.mdなどのMarkdownリソースを通じて、専門的なガイダンスを提供します。WorkflowEnvironmentを介したタイムスキッピングの実装を支援し、数ヶ月かかるワークフローを数秒で実行可能なテストへと変換します。また、ActivityEnvironmentを使用した分離されたアクティビティテストや、ワークフローのロジックを外部依存関係から切り離すためのモック戦略も利用できます。目標は、迅速なフィードバックループを維持しながら、ワークフローとアクティビティの両方で少なくとも80%のロジックカバレッジを達成することです。
エージェントができること
- 1長時間実行されるワークフローテストの高速化タイムスキッピングを使用して、通常は数ヶ月かかるワークフローをわずか数秒でテストします。
- 2依存関係からのワークフローロジックの分離アクティビティをモック化して統合テストを実装し、外部依存関係が結果に影響を与えないようにします。
- 3ワークフローの決定論の確保本番環境の履歴をリプレイすることで、ワークフローの変更が決定論的であることを検証します。
- 4ローカル開発環境の構成Docker Composeやpytestの設定を含む、完全なローカル開発スタックをセットアップします。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
temporal-python-testing skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。プラグインにtemporal-python-testing skillをインストールする
/plugin marketplace add wshobson/agents /plugin install backend-development@claude-code-workflows
Claude Codeにtemporal-python-testing skillをインストールする
~/.claude/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.claude/skills/temporal-python-testingClaude Code (project)にtemporal-python-testing skillをインストールする
.claude/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing .claude/skills/temporal-python-testingCodexにtemporal-python-testing skillをインストールする
~/.agents/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.agents/skills/temporal-python-testingGemini CLIにtemporal-python-testing skillをインストールする
~/.gemini/skills/temporal-python-testing/SKILL.md
$ npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.gemini/skills/temporal-python-testingClaude.aiにtemporal-python-testing skillをインストールする
npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing temporal-python-testing && zip -r temporal-python-testing.zip temporal-python-testing # claude.ai → Customize → Skills → + → Create skill → Upload a skill → temporal-python-testing.zip
自動チェック
実行日 2026年11月13日詳細レポート →自動チェックに合格しました。これはセキュリティ監査ではありません。エージェントに実行させる前にスクリプトを読んでください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能wshobson/agents/plugins/backend-development/skills/temporal-python-testing is public and reachablegithub.com/wshobson/agents/tree/HEAD/plugins/backend-develop ↗合格
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit 2026-11-09github.com/wshobson/agents/commits ↗合格
- スクリプトにダウンロード実行や認証情報の窃取がないNo scripts in the skill folder合格
- SKILL.md に隠れた指示がないNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/wshobson/agents/blob/HEAD/plugins/backend-develop ↗合格
- 事前許可ツールが限定されているNo pre-approved tools; the agent asks before using onegithub.com/wshobson/agents/blob/HEAD/plugins/backend-develop ↗合格
SKILL.md
GitHubで表示Temporal Python Testing Strategies
Comprehensive testing approaches for Temporal workflows using pytest, progressive disclosure resources for specific testing scenarios.
When to Use This Skill
- Unit testing workflows - Fast tests with time-skipping
- Integration testing - Workflows with mocked activities
- Replay testing - Validate determinism against production histories
- Local development - Set up Temporal server and pytest
- CI/CD integration - Automated testing pipelines
- Coverage strategies - Achieve ≥80% test coverage
Testing Philosophy
Recommended Approach (Source: docs.temporal.io/develop/python/testing-suite):
- Write majority as integration tests
- Use pytest with async fixtures
- Time-skipping enables fast feedback (month-long workflows → seconds)
- Mock activities to isolate workflow logic
- Validate determinism with replay testing
Three Test Types:
- Unit: Workflows with time-skipping, activities with ActivityEnvironment
- Integration: Workers with mocked activities
- End-to-end: Full Temporal server with real activities (use sparingly)
Available Resources
This skill provides detailed guidance through progressive disclosure. Load specific resources based on your testing needs:
Unit Testing Resources
File: resources/unit-testing.md
When to load: Testing individual workflows or activities in isolation
Contains:
- WorkflowEnvironment with time-skipping
- ActivityEnvironment for activity testing
- Fast execution of long-running workflows
- Manual time advancement patterns
- pytest fixtures and patterns
Integration Testing Resources
File: resources/integration-testing.md
When to load: Testing workflows with mocked external dependencies
Contains:
- Activity mocking strategies
- Error injection patterns
- Multi-activity workflow testing
- Signal and query testing
- Coverage strategies
Replay Testing Resources
File: resources/replay-testing.md
When to load: Validating determinism or deploying workflow changes
Contains:
- Determinism validation
- Production history replay
- CI/CD integration patterns
- Version compatibility testing
Local Development Resources
File: resources/local-setup.md
When to load: Setting up development environment
Contains:
- Docker Compose configuration
- pytest setup and configuration
- Coverage tool integration
- Development workflow
Quick Start Guide
Basic Workflow Test
import pytest
from temporalio.testing import WorkflowEnvironment
from temporalio.worker import Worker
@pytest.fixture
async def workflow_env():
env = await WorkflowEnvironment.start_time_skipping()
yield env
await env.shutdown()
@pytest.mark.asyncio
async def test_workflow(workflow_env):
async with Worker(
workflow_env.client,
task_queue="test-queue",
workflows=[YourWorkflow],
activities=[your_activity],
):
result = await workflow_env.client.execute_workflow(
YourWorkflow.run,
args,
id="test-wf-id",
task_queue="test-queue",
)
assert result == expected
Basic Activity Test
from temporalio.testing import ActivityEnvironment
async def test_activity():
env = ActivityEnvironment()
result = await env.run(your_activity, "test-input")
assert result == expected_output
Coverage Targets
Recommended Coverage (Source: docs.temporal.io best practices):
- Workflows: ≥80% logic coverage
- Activities: ≥80% logic coverage
- Integration: Critical paths with mocked activities
- Replay: All workflow versions before deployment
Key Testing Principles
- Time-Skipping - Month-long workflows test in seconds
- Mock Activities - Isolate workflow logic from external dependencies
- Replay Testing - Validate determinism before deployment
- High Coverage - ≥80% target for production workflows
- Fast Feedback - Unit tests run in milliseconds
How to Use Resources
Load specific resource when needed:
- "Show me unit testing patterns" → Load
resources/unit-testing.md - "How do I mock activities?" → Load
resources/integration-testing.md - "Setup local Temporal server" → Load
resources/local-setup.md - "Validate determinism" → Load
resources/replay-testing.md
Additional References
- Python SDK Testing: docs.temporal.io/develop/python/testing-suite
- Testing Patterns: github.com/temporalio/temporal/blob/main/docs/development/testing.md
- Python Samples: github.com/temporalio/samples-python
このスキルのファイル
5temporal-python-testing skillに関する質問
Claude Codeにtemporal-python-testing skillをインストールするには
npx degit wshobson/agents/plugins/backend-development/skills/temporal-python-testing ~/.claude/skills/temporal-python-testingを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
temporal-python-testing skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
タイムスキッピングはテストにどのようなメリットがありますか?
タイムスキッピングを利用することで、数ヶ月にわたるワークフローをわずか数秒でテストでき、迅速なフィードバックが可能になります。