Generalize VCR testing infrastructure for user workflows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #857 @mathiusj による — マージされずにクローズ
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- ruby
調査の方向性
まず docs/TESTING_GENERALIZATION_PLAN.md から始め、次に test/examples/support/functional_test.rb と test/test_helper.rb を調べて、既存の VCR セットアップと sandbox の動作を理解してください。これらの詳細を、公開ヘルパー、オプションの VCR サポート、ドキュメント、注釈付きのサンプルテストを含む Phase 1 の目標と比較してください。ユーザーが実際の認証情報なしで任意のワークフローをテストできるようになれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Context
The VCR testing infrastructure was successfully implemented for the examples tests in PR #655. Currently, it lives entirely within Roast's internal test suite (test/examples/support/functional_test.rb under the Examples::FunctionalTest namespace) and is only usable for testing the built-in examples.
Sam's ask: "now that you have the VCR tests merged, I think another high impact item related to that would be to generalize the system so anybody can use it to write tests for their roast workflows, not just our examples."
A planning doc already exists at docs/TESTING_GENERALIZATION_PLAN.md with detailed implementation steps.
Goal
Make it easy for anyone to write reliable, fast tests for their Roast workflows without needing real API credentials or incurring costs.
What Needs to Change
Current State
Examples::FunctionalTestis a private test base class intest/examples/support/- VCR config is hardcoded in
test/test_helper.rb(cassette dir, fake credentials, base URL) in_sandboxcopiesexamples/directory — not useful for external workflows- VCR and WebMock are dev-only dependencies (
require: false) - No
lib/roast/testing/exists — zero public test helpers - No documentation on testing workflows
Target State
- Public
Roast::Testing::WorkflowTestbase class users can inherit from - Configurable VCR setup (cassette dir, credentials, base URL)
in_sandboxworks with any workflow directory, not justexamples/- VCR is optional (graceful degradation when not installed)
- Clear documentation and annotated example tests
Implementation Plan
Phase 1: Minimal Viable Version
- Extract test helper to public API — Move
FunctionalTesttolib/roast/testing/workflow_test.rbasRoast::Testing::WorkflowTest, parameterize hardcoded paths - Make VCR optional — Runtime check with
defined?(VCR), graceful fallback for users without it - Write testing documentation —
docs/TESTING.mdwith quick start, recording, assertions, troubleshooting - Add annotated example test —
examples/test/showing real test patterns
Phase 2: Polish
- Generator command —
roast test:initto scaffold test boilerplate (test_helper.rb, example test, cassette dir, .gitignore)
User Experience Target
require "roast/testing/workflow_test"
class MyWorkflowTest < Roast::Testing::WorkflowTest
test "my workflow produces expected output" do
stdout, stderr = in_sandbox :my_workflow do
Roast::Workflow.from_file("path/to/my_workflow.rb", params)
end
assert_empty stderr
assert_includes stdout, "expected output"
end
end
Recording: RECORD_VCR=true bundle exec ruby test/my_workflow_test.rb
Replay: bundle exec ruby test/my_workflow_test.rb
Open Questions
- Naming:
Roast::Testing::WorkflowTestvsRoast::TestHelpervsRoast::WorkflowTestCase? - Should VCR config be provided via a DSL method or class-level config?
- Should we support RSpec in addition to Minitest?
- Should
roast test:initbe part of Phase 1?
Related
- PR #655: VCR infrastructure for examples (merged)
- PR #582: Template shorthand syntax (merged)
docs/TESTING_GENERALIZATION_PLAN.md: Existing planning document- Issue #570: DSL migration and testing improvements
- 主要言語
- Ruby
- スター
- 1.3k
- フォーク
- 80
- 平均マージ
- 21分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/roast のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Shopify/roast#1009 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
KevinSaison/fuchikoma#14 ·
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
PowerShell session to_cmd doesn't escape embedded newlines/carriage returns, allowing statement injection対応中かも @kx7m2qd が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rapid7/metasploit-framework#22230 ·
メンテナーはふだん 2 日以内に返信
-
blast/small refactor risk/medium spend-dem
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
chriskelly/MusicWall#83 ·
メンテナーはふだん 1 日以内に返信