NPD needs significant unit test coverage
Los mantenedores suelen responder en 1 día
@DigitalVeer ya está trabajando en esto.
Desde el 27/7/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
We should improve the overall test coverage present in NPD.
Currently, NPD's unit test coverage is 46.0% of 2299 statements. There are important packages, such as the custom plugin monitor, that have close to no test coverage at all.
Recent PRs such as #1322 and #1323 showed real headroom to make NPD faster and memory effecient, and more optimization work like that is worth pursuing. NPD also stands to benefit from agent-assisted development which can help us unlock more performance and reliability improvements over time. This type of work is only safe on top of reliable test infrastructure.
The table below are packages worth targeting in a first round of unit test improvement due to their importance in NPD workloads:
| Package | Coverage | Planned work |
|---|---|---|
pkg/exporters/k8sexporter |
0.0% | export test with the fake problem client |
pkg/exporters/prometheusexporter |
0.0% | export test |
pkg/custompluginmonitor |
0.8% | table test for generateStatus |
pkg/healthchecker |
20.6% | tests for getRepairFunc, getUptimeFunc, checkForPattern |
pkg/systemlogmonitor/logwatchers/journald |
23.2% | tests for the watch loop |
pkg/systemstatsmonitor |
45.2% | fixture test for the OS feature collector |
Every other measured package is in the collapsed table. A lot of the remaining 0% rows are thin wrappers, build-time metadata, or type declarations where a unit test would not help us much immediately.
Full package test coverage
| Package | Coverage |
|---|---|
pkg/exporters/stackdriver/gce |
0.0% |
pkg/systemlogmonitor/logwatchers |
0.0% |
pkg/systemlogmonitor/logwatchers/testing |
0.0% |
pkg/version |
0.0% |
cmd/healthchecker |
0.0% |
cmd/logcounter |
0.0% |
cmd/logcounter/options |
0.0% |
pkg/exporters/stackdriver |
3.3% |
pkg/exporters/k8sexporter/problemclient |
5.4% |
pkg/problemdetector |
23.3% |
cmd/healthchecker/options |
26.5% |
cmd/nodeproblemdetector |
36.4% |
pkg/util/metrics |
44.2% |
pkg/problemdaemon |
45.0% |
pkg/systemlogmonitor |
52.2% |
cmd/options |
55.9% |
pkg/exporters |
56.2% |
pkg/logcounter |
57.9% |
pkg/util |
62.5% |
pkg/systemstatsmonitor/types |
67.6% |
pkg/util/metrics/system |
77.9% |
pkg/systemlogmonitor/logwatchers/filelog |
78.6% |
pkg/exporters/k8sexporter/condition |
78.9% |
pkg/systemlogmonitor/logwatchers/kmsg |
79.7% |
pkg/custompluginmonitor/plugin |
83.5% |
pkg/problemmetrics |
85.3% |
pkg/custompluginmonitor/types |
94.8% |
pkg/healthchecker/types |
95.6% |
pkg/exporters/stackdriver/config |
100.0% |
pkg/util/tomb |
100.0% |
pkg/types |
no tests |
pkg/systemlogmonitor/types |
no tests |
pkg/systemlogmonitor/logwatchers/types |
no tests |
pkg/logcounter/types |
no tests |
cmd/nodeproblemdetector/exporterplugins |
no tests |
cmd/nodeproblemdetector/problemdaemonplugins |
no tests |
The largest gaps exist in the custom plugin monitor, the current exporters, and the health checker, and we should target those first.
/sig node
/kind cleanup
- Lenguaje dominante
- Go
- Estrellas
- 3.5k
- Forks
- 704
- Merge medio
- 12 h 21 min
- PR fusionados (30 d)
- 3
Preparar el entorno
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 kubernetes/node-problem-detector
-
Flag --enable-k8s-exporter=false causes loss of /healthz, /conditions, and /debug/pprof endpointsAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
kubernetes/node-problem-detector#1332 ·
Los mantenedores suelen responder en 1 día
-
kind/cleanup sig/node
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
kubernetes/node-problem-detector#1331 ·
Los mantenedores suelen responder en 1 día
-
kind/bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
kubernetes/node-problem-detector#1176 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
kind/feature lifecycle/frozen
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
kubernetes/node-problem-detector#1112 · 8 comentarios ·
Los mantenedores suelen responder en 1 día
-
Networking probesAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
kubernetes/node-problem-detector#991 · 23 comentarios · 5 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de kubernetes/node-problem-detector
Issues similares
-
priority: low 🌱 type: enhancement 💅🏼
Dificultad 2/5 Medio día Aptitud para principiantes 84/100
nebari-dev/llm-serving-pack#199 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
area/helm kind/bug priority/backlog triage/accepted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
lexfrei/cloudflare-tunnel-gateway-controller#889 ·
Los mantenedores suelen responder en 1 día
-
bug difficulty: beginner documentation good first issue help wanted localization
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
wavefnd/wave-platform#140 ·
-
compiler/runtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
golang/go#81797 · 1 comentario ·
Los mantenedores suelen responder en 1 día