Node SDK: add unit tests for the partitioning serialiser
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 85/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- testing
調査の方向性
まず foreign/node/src/wire/message/partitioning.utils.ts を確認してください。このファイルには serializePartitioning、serializePartitioningValue、serializeMessageKey があります。リトルエンディアンのレイアウトについては number.utils.ts を参照してください。新しい partitioning.utils.test.ts のひな形には foreign/node/src/wire/topic/delete-topic.command.test.ts を使ってください。issue に挙げられたケース(均等な分散、パーティション ID、string・number・bigint・Buffer のキー、サポートされない値での throw)が foreign/node で npm run test:unit と npm run lint を実行して通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
serializePartitioning, serializePartitioningValue and serializeMessageKey in foreign/node/src/wire/message/partitioning.utils.ts have no unit test. The wire format is the kind (1 byte), the value length (1 byte), then the value. Balanced has an empty value, a partition id is a uint32, and a message key is a string (UTF-8), a number (uint32), a bigint (uint64) or a Buffer passed through unchanged. A wrong kind code or a changed key encoding would send messages to the wrong partition without any test failing.
Affected area / component
Node SDK
Proposed solution
Add foreign/node/src/wire/message/partitioning.utils.test.ts, modelled on foreign/node/src/wire/topic/delete-topic.command.test.ts. Build the expected bytes by hand, so the test does not call the code it checks. number.utils.ts shows the little-endian layout of uint32ToBuf and uint64ToBuf.
serializePartitioning()with no argument gives1, 0.Partitioning.PartitionId(7)gives2, 4, 7, 0, 0, 0.Partitioning.MessageKey('ab')gives3, 2, 97, 98.- A numeric key, a
bigintkey and aBufferkey each give the expected length and bytes. serializeMessageKeythrows for an unsupported value, such as a plain object cast to the key type.
How to test: npm run test:unit and npm run lint pass in foreign/node.
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 日以内に返信
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/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 日以内に返信
似ている 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 日以内に返信