Node SDK: add unit tests for the offset serialisers

Aperta Adatta ai principianti
#4,797 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
testing

Direzione di ricerca

Leggi foreign/node/src/wire/offset/offset.utils.ts e usa foreign/node/src/wire/user/create-user.command.test.ts come modello per il nuovo file foreign/node/src/wire/offset/offset.utils.test.ts. Crea a mano i buffer attesi e copri i serializzatori get, store e delete, entrambi i tipi di consumer e il rifiuto delle partizioni null. Esegui npm run test:unit e npm run lint da foreign/node; il lavoro è completo quando entrambi passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

good first issue javascript test
Description

The three serialisers in foreign/node/src/wire/offset/offset.utils.ts have no byte-level tests. serializeGetOffset writes the consumer kind byte, the consumer, stream and topic identifiers, then a flag byte (1 for a partition id, 0 for none) and a uint32. serializeStoreOffset adds a uint64 offset and a quorum acknowledgement byte, and serializeDeleteOffset adds the acknowledgement byte alone. Both throw when partitionId is null. The only existing test, offset-write.command.test.ts, checks that the caller's context is passed through and does not look at the bytes.

Affected area / component

Node SDK

Proposed solution

Add foreign/node/src/wire/offset/offset.utils.test.ts, modelled on foreign/node/src/wire/user/create-user.command.test.ts.

  • The exact bytes of a get with a partition id and a get with null.
  • A store with a large bigint offset, and a delete.
  • Both refusals when partitionId is null.
  • A group consumer (Consumer.Group) as well as Consumer.Single.
  • Build the expected buffers by hand, so the test does not call the code it checks.

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
Lingua principale
Rust
Stelle
5.2k
Fork
516
Merge medio
2g 12h
PR unite (30g)
145

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iggy

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.