mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-06-05 23:03:40 +00:00
ed80015e23
internal/forward: 45.9% -> 70.8%. Adds 14 critical-gap tests:
- Manager.startWorker registration + duplicate error + healthcheck
callback paths (status changes via MarkStarting/MarkReconnecting)
+ watchdog hung-callback (backdated heartbeat + checkWorkers).
- stopWorker delegate + stopWorkerInternal removeFromUI=false.
- DisableForward / EnableForward all error paths.
- Reload diff logic: remove-stale, keep-unchanged, port conflict,
empty new-config, currentConfig update.
- SetMDNSPublisher trivial setter.
- Watchdog.RegisterWorkerWithResponder alive/dead/transition cycle
+ pollHeartbeats direct + monitorLoop heartbeat ticker branch.
- ForwardWorker.sleepWithBackoff (normal/cancelled/verbose) +
IsAlive doneChan branch + Start terminates on cancel.
- Manager.Start port-conflict path.
- getProcessUsingPortUnix empty-bound and active-bound paths.
Remaining gaps (untestable without refactoring):
- Windows-only branches (build tag prevents execution on macOS/Linux)
- worker.run / establishForward — need a fake k8s.PortForwarder, but
the Manager field is *k8s.PortForwarder (concrete), so a mock
cannot be injected without source-level refactor.