Shared test helper to enroll a node in API integration tests
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
- 84/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza por los seis archivos de pruebas de integración enumerados en el issue y compara la configuración repetida de join token, CSR y enrollment. Lee los helpers de testing en apps/api/src/testing/ y los puntos de entrada de enrollment de fleet para identificar qué necesita que devuelva cada prueba. Añade el helper compartido, actualiza solo esas seis pruebas y ejecuta pnpm test:integration; el trabajo está terminado cuando pasa con el mismo número de pruebas y ninguna de esas pruebas importa fleet/infrastructure/.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What
Six integration tests outside the fleet module enroll a test node by importing fleet/infrastructure/ca/x509 directly to build a certificate signing request:
apps/api/src/modules/apps/application-domains-http.integration.spec.tsapps/api/src/modules/confirmations/confirmation-http.integration.spec.tsapps/api/src/modules/deployments/agent-actions-http.integration.spec.tsapps/api/src/modules/deployments/allocation-observations.integration.spec.tsapps/api/src/modules/deployments/deployment-pipeline.integration.spec.tsapps/api/src/modules/deployments/pipeline-store.integration.spec.ts
CLAUDE.md says modules never import each other's infrastructure/. Tests are not production code, but the repeated setup also duplicates the same steps: issue a join token, build a CSR, enroll.
Proposed change
Add a shared helper in apps/api/src/testing/ (for example enroll-test-node.ts) that issues a join token, builds the CSR, enrolls a node and returns what the tests need. Use it in the six tests above and remove their direct fleet/infrastructure imports. The tests inside fleet itself can keep theirs.
Done when
- None of the files listed above imports
../fleet/infrastructure/. pnpm test:integrationpasses with the same number of tests.- Nothing changes outside
src/testing/and the six tests.
Raised in the review of #290.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 7 h 17 min
- PR fusionados (30 d)
- 197
Preparar el entorno
- Sin Dockerfile ni 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 shipkeepdev/shipkeep
-
good first issue priority:P2 track:control-plane
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
shipkeepdev/shipkeep#212 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue priority:P3 track:web
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
shipkeepdev/shipkeep#144 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue priority:P3 track:control-plane
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
shipkeepdev/shipkeep#143 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue priority:P3 track:control-plane
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
shipkeepdev/shipkeep#142 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue priority:P3 track:control-plane
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
shipkeepdev/shipkeep#141 ·
Los mantenedores suelen responder en 1 día
Todos los issues de shipkeepdev/shipkeep
Issues similares
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
figma/code-connect#419 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Koenkk/zigbee-herdsman-converters#13820 ·
Los mantenedores suelen responder en 2 días
-
A live recovery copy treats a large whole number and text with the same digits as the same valueAbiertobug sharing & sync
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día