Go SDK: add unit tests for ClusterNodeRole
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
テスト対象のメソッドは、foreign/go/contracts/role.go にある ClusterNodeRoleTryFrom、MarshalBinary、UnmarshalBinary、String です。同じフォルダの compression_algorithm_test.go を読み、そのテーブルテストのスタイルを、パッケージ iggcon の新しい role_test.go にそのまま写してください。バイト 0、1、2 のケース、バイナリのラウンドトリップ、nil とサポート外バイトのエラーケース、3 つの String 出力を網羅します。foreign/go で go test ./contracts/... と go vet ./... が通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
ClusterNodeRoleTryFrom, MarshalBinary, UnmarshalBinary and String in foreign/go/contracts/role.go have no test of their own. ClusterNodeRoleTryFrom accepts only 0 (leader) and 1 (follower) and returns ierror.ErrInvalidCommand otherwise. UnmarshalBinary rejects an empty slice. String returns leader, follower or unknown. Other tests use the role constants as fixtures, but none checks these methods.
Affected area / component
Go SDK
Proposed solution
Add foreign/go/contracts/role_test.go in package iggcon, modelled on compression_algorithm_test.go in the same folder.
- A table test over bytes 0, 1 and 2 for
ClusterNodeRoleTryFrom, checking the value or the error. - A round trip through
MarshalBinaryandUnmarshalBinary. - Check that
UnmarshalBinary(nil)and an invalid byte return the error. - Check the three
Stringoutputs.
How to test: go test ./contracts/... and go vet ./... pass in foreign/go.
Good first issue
- I think this could be a good first issue for a new contributor
- 主要言語
- Rust
- スター
- 5.3k
- フォーク
- 548
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 194
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iggy のほかの issue
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
-
good first issue java test
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
good first issue javascript test
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
good first issue javascript test
難易度 2/5 半日 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
bug triaged tui ux wontfix
難易度 2/5 半日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bevyengine/bevy#26642 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信