automated testing for action invariants

オープン
#31 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust

調査の方向性

この issue では具体的なファイルやテストが指定されていないため、まず Steno の既存の action API と undo-action API を確認します。consumer が同等の外部状態を報告し、再試行可能なエラーを注入するにはどうすればよいかを判断します。action の繰り返し、undo-action の繰り返し、undo-action 後の action の動作、注入された失敗について、自動テストによるカバレッジを追加できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Steno expects action implementations to meet a few invariants (these come from distributed sagas in general):

  • actions are idempotent
  • undo actions are idempotent
  • "undo" should be commutative with the action. That is, if an undo action is executed followed by a re-execution of the action itself, the net result should be as though the undo action ran last.
  • what others?

We cannot test that actions are correct or even that they always obey these invariants. But we could empirically test a lot of different cases, like:

  • after an action runs to completion, run it again. It should succeed again and the resulting external state should be equivalent. (Steno can't know the second part but the consumer can help here.)
  • after an undo action runs to completion, run it again. It should succeed again and the external state should be equivalent.
  • run the action again after the undo action completes. It should succeed again and the external state should be equivalent.

If we could inject a retryable error into either the action or undo action, then we could also test that they can fail (multiple times in a row), then remove the injected error, and then run it again and have them succeed.

All of this requires that the consumer be able to tell us whether the external states of the world are equivalent (or, maybe equivalently, whether they've changed).

主要言語
Rust
スター
174
フォーク
15
平均マージ
1日 23時間
マージ済み PR(30日)
8

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/steno のほかの issue

oxidecomputer/steno の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。