feat: add orchestrator shadow observability
This commit is contained in:
@@ -138,6 +138,22 @@ test('admin orchestrator routes expose a versioned plug-in control plane', async
|
||||
};
|
||||
},
|
||||
},
|
||||
orchestratorObservabilityService: {
|
||||
async listShadowRuns(options) {
|
||||
assert.deepEqual(options, { hours: '12', limit: '25', status: 'failed' });
|
||||
return {
|
||||
metrics: { observations: 1, successes: 0, failures: 1 },
|
||||
runs: [{ runId: 'run-shadow-1', shadowStatus: 'failed' }],
|
||||
};
|
||||
},
|
||||
async getShadowRun(runId) {
|
||||
assert.equal(runId, 'run-shadow-1');
|
||||
return {
|
||||
native: { runId, status: 'succeeded' },
|
||||
remote: { available: true, events: [{ type: 'workflow_validated' }] },
|
||||
};
|
||||
},
|
||||
},
|
||||
plazaPosts: null,
|
||||
plazaOps: null,
|
||||
wechatAdmin: null,
|
||||
@@ -174,6 +190,20 @@ test('admin orchestrator routes expose a versioned plug-in control plane', async
|
||||
const runtimeBody = await runtimeResponse.json();
|
||||
assert.equal(runtimeBody.source, 'admin-db');
|
||||
assert.equal(runtimeBody.serviceHealth.status, 'healthy');
|
||||
|
||||
const shadowRunsResponse = await fetch(
|
||||
`${server.baseUrl}/admin-api/orchestrator/shadow-runs?hours=12&limit=25&status=failed`,
|
||||
{ headers: { cookie: 'h5_user_session=token-admin' } },
|
||||
);
|
||||
assert.equal(shadowRunsResponse.status, 200);
|
||||
assert.equal((await shadowRunsResponse.json()).metrics.failures, 1);
|
||||
|
||||
const shadowRunResponse = await fetch(
|
||||
`${server.baseUrl}/admin-api/orchestrator/shadow-runs/run-shadow-1`,
|
||||
{ headers: { cookie: 'h5_user_session=token-admin' } },
|
||||
);
|
||||
assert.equal(shadowRunResponse.status, 200);
|
||||
assert.equal((await shadowRunResponse.json()).remote.available, true);
|
||||
} finally {
|
||||
await server.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user