Node SDK: add unit tests for the offset serialisers

Abierto Apto para principiantes
#4,797 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
testing

Línea de trabajo

Lee foreign/node/src/wire/offset/offset.utils.ts y usa foreign/node/src/wire/user/create-user.command.test.ts como modelo para el nuevo archivo foreign/node/src/wire/offset/offset.utils.test.ts. Construye a mano los buffers esperados y cubre los serializadores de get, store y delete, ambos tipos de consumer y el rechazo de particiones null. Ejecuta npm run test:unit y npm run lint desde foreign/node; se considerará terminado cuando ambos pasen.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Rust
Estrellas
5.2k
Forks
516
Merge medio
2 d 12 h
PR fusionados (30 d)
145

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iggy

Todos los issues de apache/iggy

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.