[Foundation] Make BuildContext's cancellation handlers testable
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- csharp
- 領域
- build-system, testing
調査の方向性
BuildContext.RegisterCancellationHandler と UnregisterCancellationHandler から始め、Console.CancelKeyPress のサブスクリプションと BuildManager.CancellationHandler ファサードを追跡します。実際の Ctrl+C を使わずに、登録、登録解除、コンテキスト分離が検証されるよう specs を追加または更新します。完了条件は、seam が内部に維持され、4 つの受け入れ基準をすべて満たすことです。
索引モデルが issue の本文から書いたものです。
説明
Follow-up from #451 (FT-2, #307).
Problem
BuildContext.RegisterCancellationHandler / UnregisterCancellationHandler — the two methods BuildManager.CancellationHandler exists to delegate to — have no positive coverage. The only spec on the facade (Cancellation_handler_facade_is_a_no_op_without_an_active_context) exercises the null-context path.
They can't be tested as written: registered handlers only run from the Console.CancelKeyPress subscription, and ConsoleCancelEventArgs has no public constructor, so the event can't be raised from a spec.
Outcome
A registered handler can be shown to run, and an unregistered one shown not to, without depending on a real Ctrl+C.
Needs a seam — e.g. an internal void InvokeCancellationHandlers() on BuildContext that the CancelKeyPress subscription calls, so specs can drive the same path. Worth settling before FT-4/5/6 move more per-run services onto the context.
Acceptance criteria
- Registering through
BuildManager.CancellationHandlerwith an active context runs the handler when cancellation is signalled. - Unregistering stops it running.
- Handlers registered against one context don't run for another.
- The seam stays
internal— noInternalsVisibleToto non-test assemblies.
- 主要言語
- C#
- スター
- 172
- フォーク
- 21
- 平均マージ
- 4日 38分
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Fallout-build/Fallout のほかの issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Fallout-build/Fallout#729 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Fallout-build/Fallout#708 ·
メンテナーはふだん 2 日以内に返信
-
.\build.ps1 in its current state isn't capable for :add-package command対応中かも @ITaluone が 46 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Fallout-build/Fallout#670 ·
メンテナーはふだん 2 日以内に返信
-
CD enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Fallout-build/Fallout#649 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Fallout-build/Fallout#630 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
Fallout-build/Fallout の issue をすべて見る
似ている issue
-
track:release
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK status対応中かも @leizhiyuan が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apache/rocketmq-clients#1465 ·
メンテナーはふだん 2 日以内に返信
-
fix(testing): HeadlessTerminal disposes services synchronously対応中かも @zidad が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
RazorConsole/RazorConsole#388 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
starlinghq/starling#209 ·
メンテナーはふだん 1 日以内に返信