Implement Monlet MVP stack and UI updates

This commit is contained in:
Stanislav Rossovskii
2026-05-27 10:01:59 +04:00
parent dcea096327
commit edc51e9c59
145 changed files with 15618 additions and 248 deletions

View File

@@ -24,8 +24,13 @@ func TestSendHeartbeatSuccess(t *testing.T) {
_, _ = io.WriteString(w, `{"accepted":true}`)
}))
defer srv.Close()
c := New(srv.URL, "tok", "a1", "v0")
err := c.SendHeartbeat(context.Background(), HeartbeatRequest{AgentID: "a1", ObservedAt: time.Now().UTC(), Hostname: "h", Version: "v0"})
c := New(srv.URL, "tok", "a1")
err := c.SendHeartbeat(context.Background(), HeartbeatRequest{
AgentID: "a1",
ObservedAt: time.Now().UTC(),
Hostname: "h",
Features: AgentFeatures{Push: true, Metrics: false},
})
if err != nil {
t.Fatal(err)
}
@@ -42,7 +47,7 @@ func TestSendEventsBatch(t *testing.T) {
_, _ = io.WriteString(w, `{"accepted":2,"deduplicated":0}`)
}))
defer srv.Close()
c := New(srv.URL, "tok", "a1", "v0")
c := New(srv.URL, "tok", "a1")
resp, err := c.SendEvents(context.Background(), []scheduler.Event{{EventID: "x"}, {EventID: "y"}})
if err != nil {
t.Fatal(err)
@@ -53,7 +58,7 @@ func TestSendEventsBatch(t *testing.T) {
}
func TestSendEventsTooBig(t *testing.T) {
c := New("http://x", "t", "a1", "v0")
c := New("http://x", "t", "a1")
big := make([]scheduler.Event, MaxBatchEvents+1)
_, err := c.SendEvents(context.Background(), big)
if err == nil {