Close automatable P2 test gaps with mocks and httptest integration.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add container/podman exec mocks, BITS/curl HiddenRun coverage, WinRM/GPO/systemd deploy-plan httptest, and a 3-hop discover-spread Playwright stub chain.
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
ensureDiscoverSpreadStub,
|
||||
E2E_DISCOVER_AGENT_HOSTNAME,
|
||||
E2E_DISCOVER_AGENT_ID,
|
||||
E2E_DISCOVER_CHAIN_HOPS,
|
||||
E2E_DISCOVER_JOIN_LABEL,
|
||||
isDiscoverSpreadStubReady,
|
||||
} from './discover-spread-stub';
|
||||
@@ -93,5 +94,41 @@ test.describe('Crucible discover and spread E2E', () => {
|
||||
timeout: 15_000,
|
||||
});
|
||||
});
|
||||
|
||||
test('multi-hop chain propagates join lanes across egress seed and leaf', async ({ page }) => {
|
||||
const [egress, seed, leaf] = E2E_DISCOVER_CHAIN_HOPS;
|
||||
await openCrucibleSpreadTab(page, egress.hostname);
|
||||
|
||||
const commandRequest = page.waitForRequest(
|
||||
(req) =>
|
||||
req.method() === 'POST' &&
|
||||
req.url().includes(`/api/v1/agents/${egress.id}/command`) &&
|
||||
req.postDataJSON()?.action === 'discover_and_join',
|
||||
);
|
||||
|
||||
await page.getByRole('button', { name: 'Probe & Join' }).click();
|
||||
await commandRequest;
|
||||
|
||||
await expect(page.locator('.crucible-terminal')).toContainText('multi-hop chain', {
|
||||
timeout: 10_000,
|
||||
});
|
||||
await expect(page.locator('.access-depth-panel')).toContainText(egress.joinLabel, {
|
||||
timeout: 15_000,
|
||||
});
|
||||
|
||||
for (const hop of [seed, leaf]) {
|
||||
const card = page.locator('.crucible-node-card').filter({ hasText: hop.hostname });
|
||||
await expect(card).toBeVisible({ timeout: 15_000 });
|
||||
await expect(card.locator('.cn-status-dot.on')).toBeVisible({ timeout: 15_000 });
|
||||
await card.click();
|
||||
await expect(
|
||||
page.locator('.crucible-actions-card').getByText(new RegExp(`→ ${hop.hostname}`)),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
await page.getByRole('button', { name: 'LATERAL / SPREAD' }).click();
|
||||
await expect(page.locator('.access-depth-panel')).toContainText(hop.joinLabel, {
|
||||
timeout: 20_000,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user