Node SDK: add unit tests for the partitioning serialiser
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- testing
Línea de trabajo
Empieza con foreign/node/src/wire/message/partitioning.utils.ts, que contiene serializePartitioning, serializePartitioningValue y serializeMessageKey, y con number.utils.ts para el diseño little-endian. Usa foreign/node/src/wire/topic/delete-topic.command.test.ts como patrón para el nuevo partitioning.utils.test.ts. Está terminado cuando los casos listados en el issue (distribución equilibrada, ID de partición, claves string, number, bigint y Buffer, y el throw para un valor no soportado) pasan con npm run test:unit y npm run lint en foreign/node.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Rust
- Estrellas
- 5.3k
- Forks
- 548
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 194
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/iggy
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
good first issue java test
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
good first issue javascript test
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
Todos los issues de apache/iggy
Issues similares
-
bug triaged tui ux wontfix
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
bevyengine/bevy#26642 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día