Expand test coverage across server, agent, and web; fix bugs found during audit.

Adds hundreds of unit/integration/e2e tests, fixes WS bcrypt auth, config merge, fleet analytics, agent schedule/log tail, and documents stale PROBLEMS items. Updates PROBLEMS.md, README, and test scripts; ignores local spread-kits and coverage dirs.
This commit is contained in:
AetherForge
2026-05-31 01:13:49 -07:00
parent 159747877c
commit ea6f54ad03
89 changed files with 5307 additions and 322 deletions

View File

@@ -10,8 +10,6 @@ import (
"net/http/httptest"
"strings"
"testing"
"crypto-miner-server/internal/db"
)
// stubConfigProvider implements ConfigProvider for handler unit tests.
@@ -39,17 +37,12 @@ func (s *stubConfigProvider) UpdateConfigFromJSON(data json.RawMessage) error {
func newTestConfigHandler(t *testing.T, cp ConfigProvider) *ConfigHandler {
t.Helper()
database, err := db.New(t.TempDir())
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() { database.Close() })
return NewConfigHandler(database, cp)
return NewConfigHandler(cp)
}
func TestNewConfigHandler(t *testing.T) {
h := newTestConfigHandler(t, &stubConfigProvider{})
if h == nil || h.config == nil || h.db == nil {
if h == nil || h.config == nil {
t.Fatal("NewConfigHandler returned incomplete handler")
}
}