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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user