Harden production workflows and agent admission
This commit is contained in:
@@ -6,12 +6,23 @@ const now = new Date().toISOString();
|
||||
|
||||
const fixtures = {
|
||||
"/api/v1/health": { status: "ok" },
|
||||
"/api/v1/system-summary": {
|
||||
agents_online: 1,
|
||||
agents_offline: 1,
|
||||
checks_ok: 2,
|
||||
checks_warning: 1,
|
||||
checks_critical: 1,
|
||||
open_incidents: 2,
|
||||
generated_at: now,
|
||||
},
|
||||
"/api/v1/agents": {
|
||||
items: [
|
||||
{
|
||||
agent_id: "agent-1",
|
||||
hostname: "host-1",
|
||||
status: "alive",
|
||||
admission_state: "accepted",
|
||||
key_fingerprint: "1111111111111111",
|
||||
last_seen_at: now,
|
||||
features: { push: true, metrics: false },
|
||||
labels: { env: "dev", monlet_agent_version: "0.1.0" },
|
||||
@@ -20,6 +31,8 @@ const fixtures = {
|
||||
agent_id: "agent-2",
|
||||
hostname: "host-2",
|
||||
status: "dead",
|
||||
admission_state: "accepted",
|
||||
key_fingerprint: "2222222222222222",
|
||||
last_seen_at: now,
|
||||
features: { push: true, metrics: false },
|
||||
labels: {},
|
||||
@@ -31,6 +44,8 @@ const fixtures = {
|
||||
agent_id: "agent-1",
|
||||
hostname: "host-1",
|
||||
status: "alive",
|
||||
admission_state: "accepted",
|
||||
key_fingerprint: "1111111111111111",
|
||||
last_seen_at: now,
|
||||
features: { push: true, metrics: false },
|
||||
labels: { env: "dev", monlet_agent_version: "0.1.0" },
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("overview renders tallies", async ({ page }) => {
|
||||
test("root redirects to agents with nav counters", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page.getByRole("heading", { name: "Overview" })).toBeVisible();
|
||||
await expect(page.locator("body")).toContainText("Agents");
|
||||
await expect(page.locator("body")).toContainText("Checks");
|
||||
await expect(page).toHaveURL(/\/agents$/);
|
||||
await expect(page.getByRole("heading", { name: "Agents" })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: /Agents.*1.*1/ })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: /Checks.*2.*1.*1/ })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: /Incidents.*2/ })).toBeVisible();
|
||||
});
|
||||
|
||||
test("agents list links to detail", async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user