mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 04:33:17 +00:00
Keep PBS History E2E fixtures faithful to validated responses
PR2457 Core E2E run 37188438472 fails both PBS chart assertions in three browser projects because its mock omits range and start/end fields required by the reviewed response admission contract. Supply the real response envelope and one consistent point interval; retain target identity checks and all chart assertions. No product validator or release gate changes. Change-source: pulse-maintainer
This commit is contained in:
@@ -116,7 +116,18 @@ for (const width of [1280, 390]) {
|
||||
await page.route('**/api/metrics-store/history?**', async route => {
|
||||
const q = new URL(route.request().url()).searchParams;
|
||||
targets.push(`${q.get('resourceType')}/${q.get('resourceId')}`);
|
||||
await route.fulfill({ json: { metrics: { cpu: [0, 1, 2].map(i => ({ timestamp: Date.now() - (2-i)*60000, value: 10+i, min: 10+i, max: 10+i, count: 1 })), memory: [0, 1, 2].map(i => ({ timestamp: Date.now() - (2-i)*60000, value: 20+i, min: 20+i, max: 20+i, count: 1 })) }, resourceId: q.get('resourceId'), resourceType: q.get('resourceType') } });
|
||||
// Match the real history envelope. Response admission deliberately rejects
|
||||
// missing selection/range bounds, even when the metric points are valid.
|
||||
const end = Date.now();
|
||||
const start = end - 120_000;
|
||||
await route.fulfill({ json: {
|
||||
resourceId: q.get('resourceId'), resourceType: q.get('resourceType'),
|
||||
range: q.get('range') || '24h', start, end, source: 'store',
|
||||
metrics: {
|
||||
cpu: [0, 1, 2].map(i => ({ timestamp: start + i*60000, value: 10+i, min: 10+i, max: 10+i, count: 1 })),
|
||||
memory: [0, 1, 2].map(i => ({ timestamp: start + i*60000, value: 20+i, min: 20+i, max: 20+i, count: 1 })),
|
||||
},
|
||||
} });
|
||||
});
|
||||
await page.goto('/proxmox/backups', { waitUntil: 'domcontentloaded' });
|
||||
for (const type of ['vm', 'agent']) {
|
||||
|
||||
Reference in New Issue
Block a user