ServiceMap: update tests and backend/app (+7 areas)
Public changes compared with the previous published export: 89 files changed. Affected areas: - backend/app: 21 files - dependencies: 5 files - deployment and CI: 6 files - documentation: 2 files - frontend: 3 files - frontend/src: 20 files - project files: 1 file - tests: 30 files - unraid: 1 file Changed files: - Updated: ".env.example" - Updated: "Dockerfile.unraid" - Updated: "README.md" - Updated: "backend/Dockerfile" - Added: "backend/app/alerts.py" - Updated: "backend/app/auth.py" - Added: "backend/app/backups.py" - Updated: "backend/app/config_io.py" - Updated: "backend/app/demo.py" - Updated: "backend/app/discovery.py" - Updated: "backend/app/discovery_store.py" - Updated: "backend/app/docker_discovery.py" - Updated: "backend/app/events.py" - Updated: "backend/app/evidence.py" - Updated: "backend/app/health.py" - Updated: "backend/app/incidents.py" - Added: "backend/app/loops.py" - Updated: "backend/app/main.py" - Updated: "backend/app/models.py" - Updated: "backend/app/observation.py" - Updated: "backend/app/probes.py" - Added: "backend/app/response_cache.py" - Updated: "backend/app/scheduler.py" - Updated: "backend/app/semantic.py" - Updated: "backend/app/store.py" - Updated: "backend/pyproject.toml" - Updated: "backend/tests/test_api.py" - Updated: "backend/tests/test_config_io.py" - Updated: "backend/tests/test_demo.py" - Updated: "backend/tests/test_discovery_v120.py" - Updated: "backend/tests/test_health.py" - Updated: "backend/tests/test_probes.py" - Updated: "backend/tests/test_scheduler.py" - Updated: "backend/tests/test_v130_probe_reachability.py" - Updated: "backend/tests/test_v160_evidence_changes.py" - Added: "backend/tests/test_v163_alerts.py" - Added: "backend/tests/test_v163_backups.py" - Added: "backend/tests/test_v163_data_integrity.py" - Added: "backend/tests/test_v163_efficiency.py" - Added: "backend/tests/test_v163_health_performance.py" - Added: "backend/tests/test_v163_loops.py" - Added: "backend/tests/test_v163_management.py" - Added: "backend/tests/test_v163_realtime.py" - Added: "backend/tests/test_v163_security.py" - Added: "backend/tests/test_v163_semantic_etag.py" - Added: "compose.demo.yaml" - Updated: "compose.yaml" - Added: "docker-compose.broker.yml" - Updated: "docker-compose.yml" - Updated: "docs/ARCHITECTURE.md" - Added: "frontend/e2e/a11y.spec.ts" - Updated: "frontend/e2e/demo.spec.ts" - Updated: "frontend/index.html" - Updated: "frontend/nginx.conf" - Updated: "frontend/package-lock.json" - Updated: "frontend/package.json" - Updated: "frontend/playwright.config.ts" - Updated: "frontend/src/App.tsx" - Updated: "frontend/src/LivingEdge.tsx" - Added: "frontend/src/activityView.test.ts" - Added: "frontend/src/activityView.ts" - Updated: "frontend/src/api.ts" - Added: "frontend/src/apiAuth.test.ts" - Added: "frontend/src/components/ActionsMenu.tsx" - Added: "frontend/src/components/ConfirmDialog.test.tsx" - Added: "frontend/src/components/ConfirmDialog.tsx" - Added: "frontend/src/components/StatusIcon.tsx" - Updated: "frontend/src/demo/DemoWalkthrough.test.ts" - Updated: "frontend/src/demo/DemoWalkthrough.tsx" - Added: "frontend/src/elk-worker-url.d.ts" - Added: "frontend/src/labels.ts" - Updated: "frontend/src/main.tsx" - Added: "frontend/src/realtime/refreshPlan.test.ts" - Added: "frontend/src/realtime/refreshPlan.ts" - Updated: "frontend/src/realtime/useRealtimeEvents.ts" - Added: "frontend/src/routing/urlState.test.ts" - Added: "frontend/src/routing/urlState.ts" - Updated: "frontend/src/styles.css" - Added: "frontend/src/topology/GraphListView.test.tsx" - Added: "frontend/src/topology/GraphListView.tsx" - Updated: "frontend/src/topology/ServiceNode.tsx" - Updated: "frontend/src/topology/TopologyCommandBar.tsx" - Added: "frontend/src/topology/semanticGraph.test.ts" - Updated: "frontend/src/topology/semanticGraph.ts" - Added: "frontend/src/topologyLayout.test.ts" - Updated: "frontend/src/topologyLayout.ts" - Updated: "package-lock.json" - Updated: "package.json" - Updated: "unraid/my-servicemap.xml" Export provenance/manifests refreshed; excluded from the change summary. Publish curated ServiceMap source from af46f684e468dffd3a5190e28d3b572d4c26bfd7
This commit is contained in:
1 parent
d7319250e8
commit
adc2c70c21
91 files changed
+9205
-1691
No files matched your search
@@ -0,0 +1,68 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { expect, test, type APIRequestContext } from "@playwright/test";
|
||||
|
||||
async function ensureServices(request: APIRequestContext) {
|
||||
await request.post("/api/v1/demo/exit");
|
||||
const existing = (await (await request.get("/api/v1/services")).json()) as { service: { name: string } }[];
|
||||
const names = new Set(existing.map((item) => item.service.name));
|
||||
for (const name of ["A11y Database", "A11y API"]) {
|
||||
if (names.has(name)) continue;
|
||||
const response = await request.post("/api/v1/services", {
|
||||
data: { name, kind: "tcp", host: "127.0.0.1", port: 9, environment: "test" },
|
||||
});
|
||||
expect(response.ok(), await response.text()).toBeTruthy();
|
||||
}
|
||||
}
|
||||
|
||||
test.beforeEach(async ({ request }) => {
|
||||
await ensureServices(request);
|
||||
});
|
||||
|
||||
const PANELS = ["topology", "overview", "incidents", "services", "discovery", "changes", "activity", "config", "settings"];
|
||||
|
||||
for (const panel of PANELS) {
|
||||
test(`${panel} has no serious or critical axe violations`, async ({ page }) => {
|
||||
await page.goto(`/#/${panel}`);
|
||||
await expect(page.getByRole("navigation", { name: "ServiceMap-werkruimtes" })).toBeVisible();
|
||||
await expect(page.locator("main#main-content")).toBeVisible();
|
||||
await page.waitForLoadState("networkidle");
|
||||
const results = await new AxeBuilder({ page })
|
||||
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"])
|
||||
.analyze();
|
||||
const blocking = results.violations
|
||||
.filter((violation) => violation.impact === "serious" || violation.impact === "critical")
|
||||
.map((violation) => `${violation.id}: ${violation.nodes.map((node) => node.target.join(" ")).slice(0, 5).join(" | ")}`);
|
||||
expect(blocking, blocking.join("\n")).toEqual([]);
|
||||
});
|
||||
}
|
||||
|
||||
test("navigation marks the current workspace and the skip link reaches content", async ({ page }) => {
|
||||
await page.goto("/#/services");
|
||||
await expect(page.getByRole("button", { name: "Services", exact: true })).toHaveAttribute("aria-current", "page");
|
||||
await page.keyboard.press("Tab");
|
||||
const skip = page.getByRole("link", { name: "Naar inhoud springen" });
|
||||
await expect(skip).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.locator("main#main-content")).toBeFocused();
|
||||
});
|
||||
|
||||
test("the topology can be explored with the keyboard alone", async ({ page }) => {
|
||||
await page.goto("/#/topology");
|
||||
// Canvas nodes are focusable, labelled, and open the inspector on Enter.
|
||||
const node = page.locator(".react-flow__node").first();
|
||||
// The first layout can take a while on a busy machine; wait for it, not for a fixed delay.
|
||||
await expect(node).toHaveAttribute("aria-label", /, (Gezond|Verminderd|Uitgevallen|Onbekend|Niet bewaakt|Herstellend|Onderhoud)/, {
|
||||
timeout: 30_000,
|
||||
});
|
||||
await node.focus();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page).toHaveURL(/(service|in_domain|in_app)=/);
|
||||
|
||||
// The list alternative offers the same with plain buttons.
|
||||
await page.getByRole("button", { name: "Als lijst tonen" }).click();
|
||||
const list = page.getByRole("region", { name: "Topologie als lijst" });
|
||||
await expect(list).toBeVisible();
|
||||
await list.getByRole("button").first().focus();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.getByRole("button", { name: "Grafiek tonen" })).toHaveAttribute("aria-pressed", "true");
|
||||
});
|
||||
+31
-28
@@ -39,17 +39,18 @@ test("Explore demo exposes evidence-backed root cause and reset-safe exit", asyn
|
||||
const baselineTopology = topologyOf(await baselineResponse.json());
|
||||
|
||||
await page.goto("/");
|
||||
const explore = page.getByRole("button", { name: "Explore demo", exact: true });
|
||||
// Secondary actions live in the header's overflow menu.
|
||||
await page.getByRole("button", { name: "Meer acties" }).click();
|
||||
const explore = page.getByRole("button", { name: "Demo verkennen", exact: true });
|
||||
await expect(explore).toBeEnabled({ timeout: 30_000 });
|
||||
|
||||
const loadResponsePromise = page.waitForResponse(isDemoMutation("/api/v1/demo"));
|
||||
await explore.click();
|
||||
if (baselineTopology.length > 0) {
|
||||
const confirmation = page
|
||||
.getByRole("alert")
|
||||
.filter({ hasText: "temporarily replace this topology" });
|
||||
.getByRole("dialog", { name: /vervangt deze topologie tijdelijk/ });
|
||||
await expect(confirmation).toBeVisible();
|
||||
await confirmation.getByRole("button", { name: "Explore demo", exact: true }).click();
|
||||
await confirmation.getByRole("button", { name: "Snapshot maken en verkennen", exact: true }).click();
|
||||
}
|
||||
const loadResponse = await loadResponsePromise;
|
||||
expect(loadResponse.ok()).toBeTruthy();
|
||||
@@ -99,37 +100,38 @@ test("Explore demo exposes evidence-backed root cause and reset-safe exit", asyn
|
||||
uptime_percent: 91.67,
|
||||
});
|
||||
|
||||
const demoBanner = page.getByRole("status", { name: "Explore demo scenario" });
|
||||
const demoBanner = page.getByRole("status", { name: "Demoscenario verkennen" });
|
||||
await expect(demoBanner).toBeVisible();
|
||||
await expect(demoBanner).toHaveAttribute("aria-busy", "false", { timeout: 30_000 });
|
||||
await expect(page.getByText("Demo scenario", { exact: false })).toBeVisible();
|
||||
await expect(page.getByText("Demoscenario", { exact: false })).toBeVisible();
|
||||
await expect(page.getByText("PostgreSQL", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("Likely root cause", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("Health evidence", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("Waarschijnlijke hoofdoorzaak", { exact: true })).toBeVisible();
|
||||
await expect(page.getByText("Gezondheidsbewijs", { exact: true })).toBeVisible();
|
||||
|
||||
const workspaces = page.getByRole("navigation", { name: "ServiceMap workspaces" });
|
||||
await workspaces.getByRole("button", { name: "Overview" }).click();
|
||||
await expect(page.getByRole("heading", { name: "9/9 with current health evidence" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Review unresolved" })).toBeDisabled();
|
||||
await page.locator(".overview-lead").getByRole("button", { name: /1 down/i }).click();
|
||||
const workspaces = page.getByRole("navigation", { name: "ServiceMap-werkruimtes" });
|
||||
await workspaces.getByRole("button", { name: "Overzicht" }).click();
|
||||
await expect(page.getByRole("heading", { name: "9/9 met actueel gezondheidsbewijs" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Onopgeloste nakijken" })).toBeDisabled();
|
||||
await page.locator(".overview-lead").getByRole("button", { name: /1 uitgevallen/i }).click();
|
||||
await expect(page.getByRole("combobox", { name: "Status", exact: true })).toHaveValue("down");
|
||||
await workspaces.getByRole("button", { name: "Incidents" }).click();
|
||||
await workspaces.getByRole("button", { name: "Incidenten" }).click();
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Active and historical incidents" }),
|
||||
page.getByRole("heading", { name: "Actieve en eerdere incidenten" }),
|
||||
).toBeVisible();
|
||||
await page.getByLabel("Search incidents").fill("does not exist");
|
||||
await expect(page.getByText("No incidents match these filters.")).toBeVisible();
|
||||
await page.getByLabel("Search incidents").fill("");
|
||||
await workspaces.getByRole("button", { name: "Topology", exact: true }).click();
|
||||
await expect(page.getByRole("region", { name: "Topology commands" })).toBeVisible();
|
||||
await page.getByRole("region", { name: "Topology commands" }).locator("summary").filter({ hasText: "Filters" }).click();
|
||||
await expect(page.getByRole("combobox", { name: "Filter topology by status" })).toBeVisible();
|
||||
await page.getByLabel("Incidenten zoeken").fill("does not exist");
|
||||
await expect(page.getByText("Geen incidenten voor deze filters.")).toBeVisible();
|
||||
await page.getByLabel("Incidenten zoeken").fill("");
|
||||
await workspaces.getByRole("button", { name: "Topologie", exact: true }).click();
|
||||
await expect(page.getByRole("region", { name: "Topologieopdrachten" })).toBeVisible();
|
||||
await page.getByRole("region", { name: "Topologieopdrachten" }).locator("summary").filter({ hasText: "Filters" }).click();
|
||||
await expect(page.getByRole("combobox", { name: "Topologie filteren op status" })).toBeVisible();
|
||||
const inspector = page.getByRole("complementary");
|
||||
await expect(inspector.getByRole("heading", { name: "PostgreSQL" })).toBeVisible();
|
||||
await expect(inspector.getByText("Likely root cause", { exact: true })).toBeVisible();
|
||||
await expect(inspector.getByText("Health evidence", { exact: true })).toBeVisible();
|
||||
await expect(inspector.getByText("Waarschijnlijke hoofdoorzaak", { exact: true })).toBeVisible();
|
||||
await expect(inspector.getByText("Gezondheidsbewijs", { exact: true })).toBeVisible();
|
||||
|
||||
const reset = page.locator("header").getByRole("button", { name: "Reset demo" });
|
||||
await page.getByRole("button", { name: "Meer acties" }).click();
|
||||
const reset = page.locator("header").getByRole("button", { name: "Demo opnieuw starten" });
|
||||
const resetResponsePromise = page.waitForResponse(isDemoMutation("/api/v1/demo/reset"));
|
||||
await reset.click();
|
||||
const resetResponse = await resetResponsePromise;
|
||||
@@ -143,7 +145,7 @@ test("Explore demo exposes evidence-backed root cause and reset-safe exit", asyn
|
||||
// Wait for the demo region to leave its busy state before attempting Exit.
|
||||
await expect(demoBanner).toHaveAttribute("aria-busy", "false", { timeout: 30_000 });
|
||||
await expect(page.getByText("PostgreSQL", { exact: true }).first()).toBeVisible();
|
||||
const exit = page.getByRole("button", { name: "Exit demo", exact: true });
|
||||
const exit = page.getByRole("button", { name: "Demo afsluiten", exact: true });
|
||||
await expect(exit).toBeEnabled();
|
||||
|
||||
const exitResponsePromise = page.waitForResponse(isDemoMutation("/api/v1/demo/exit"));
|
||||
@@ -154,10 +156,11 @@ test("Explore demo exposes evidence-backed root cause and reset-safe exit", asyn
|
||||
|
||||
await expect(demoBanner).toBeHidden({ timeout: 30_000 });
|
||||
await expect(
|
||||
page.getByText("Demo closed. Your previous topology was restored.", { exact: true }),
|
||||
page.getByText("Demo afgesloten. Je vorige topologie is hersteld.", { exact: true }),
|
||||
).toBeVisible();
|
||||
await page.getByRole("button", { name: "Meer acties" }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Explore demo", exact: true }),
|
||||
page.getByRole("button", { name: "Demo verkennen", exact: true }),
|
||||
).toBeEnabled({ timeout: 30_000 });
|
||||
|
||||
const restoredDemoResponse = await request.get("/api/v1/demo");
|
||||
|
||||
Reference in new issue
Block a user