Context
The Smart Router (control-plane/smart-router/main.go) uses a 4-signal scoring algorithm (KV cache, session affinity, load, latency) to pick the best cluster for each request.
Task
Add Go unit tests for the scoreCluster() function covering:
- Cache hit vs miss scoring
- Session pinned vs unpinned
- Different load ratios (0%, 50%, 100%)
- Latency scoring edge cases
- Combined scoring with different weights
Files
control-plane/smart-router/main.go — the code to test
- Create
control-plane/smart-router/main_test.go
Getting started
cd control-plane/smart-router
go test -v ./...
Good first issue — straightforward Go testing, no infrastructure needed.
Context
The Smart Router (
control-plane/smart-router/main.go) uses a 4-signal scoring algorithm (KV cache, session affinity, load, latency) to pick the best cluster for each request.Task
Add Go unit tests for the
scoreCluster()function covering:Files
control-plane/smart-router/main.go— the code to testcontrol-plane/smart-router/main_test.goGetting started
Good first issue — straightforward Go testing, no infrastructure needed.