Quick Command shows the output right under the form (#5)
CI / Lint (eslint) (pull_request) Successful in 19s
CI / Test (jest) (pull_request) Successful in 30s
CI / Security (npm audit) (pull_request) Successful in 14s
CI / Integration (api) (pull_request) Successful in 2m35s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m52s
CI / UI (playwright) (pull_request) Successful in 2m31s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m35s
CI / Lint (eslint) (pull_request) Successful in 19s
CI / Test (jest) (pull_request) Successful in 30s
CI / Security (npm audit) (pull_request) Successful in 14s
CI / Integration (api) (pull_request) Successful in 2m35s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m52s
CI / UI (playwright) (pull_request) Successful in 2m31s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m35s
After Execute, each worker gets a card that says Running until its result arrives, then shows the status (Completed, Failed (exit N), Timed out, Killed), the duration, stdout, stderr in red, and a link to the full record in Executions. Multi-worker runs get one card per worker. - The result comes from the live command_result event; one that arrives before the POST returns is buffered. If the event is missed (e.g. the live connection dropped), the card polls the execution every 5 s. - Each stream shows up to 100,000 characters, with a note pointing to Executions for the rest. - The server's command_result broadcast now includes duration. - [hidden] now always wins over component display rules: both worker pickers used to show in either mode because .lt-form-group sets display: flex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
156c311217
commit
c01e3ead32
6 files changed
+195
-64
No files matched your search
@@ -89,6 +89,7 @@ test('empty states say what to do next (#33)', async ({ page }) => {
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
await page.goto('/quick');
|
||||
await page.locator('#qc-mode-multi').check(); // the checkbox list is the multi-worker picker
|
||||
await expect(page.locator('#qc-worker-list').getByRole('link', { name: 'Workers' })).toHaveAttribute('href', '/workers');
|
||||
|
||||
await page.goto('/workflows');
|
||||
|
||||
@@ -13,8 +13,11 @@ test('a quick command runs on a worker and its output shows in Executions', asyn
|
||||
await page.locator('#qc-command').fill(`echo ${marker}`);
|
||||
await page.locator('#qc-execute-btn').click();
|
||||
|
||||
// The output shows right under the form (#5), with a link to the full record.
|
||||
const result = page.locator('#qc-result');
|
||||
await expect(result).toContainText('Command sent successfully');
|
||||
await expect(result.locator('.qc-run-status')).toHaveText(/Completed/);
|
||||
await expect(result.locator('pre.qc-out')).toHaveText(marker);
|
||||
await expect(result).toContainText('node-02');
|
||||
await result.getByRole('link', { name: 'view in Executions' }).click();
|
||||
|
||||
await expect(page).toHaveURL(/\/executions/);
|
||||
@@ -34,7 +37,10 @@ test('a failing command is reported as failed with its stderr', async ({ page })
|
||||
await page.locator('#qc-command').fill(`echo ${marker} >&2; exit 3`);
|
||||
await page.locator('#qc-command').press('Control+Enter'); // the documented shortcut
|
||||
|
||||
await page.locator('#qc-result').getByRole('link', { name: 'view in Executions' }).click();
|
||||
const result = page.locator('#qc-result');
|
||||
await expect(result.locator('.qc-run-status')).toHaveText(/Failed \(exit 3\)/);
|
||||
await expect(result.locator('pre.qc-out-err')).toHaveText(marker);
|
||||
await result.getByRole('link', { name: 'view in Executions' }).click();
|
||||
const detail = page.locator('#ex-detail-body');
|
||||
await expect(detail).toContainText(marker);
|
||||
await expect(detail).toContainText(/failed/i);
|
||||
@@ -44,13 +50,19 @@ test('multi-worker mode sends the command to every selected worker', async ({ pa
|
||||
await page.goto('/quick');
|
||||
await page.locator('label[for="qc-mode-multi"], #qc-mode-multi').first().click();
|
||||
await page.getByRole('button', { name: /select all/i }).click();
|
||||
await page.locator('#qc-command').fill(`echo ${token()}`);
|
||||
await page.locator('#qc-command').fill('echo "$WORKER_NAME says hi"');
|
||||
await page.locator('#qc-execute-btn').click();
|
||||
|
||||
// One card per worker, each with its own output (#5).
|
||||
const result = page.locator('#qc-result');
|
||||
await expect(result).toContainText('Success: 3');
|
||||
await expect(result).toContainText('Failed: 0');
|
||||
await expect(result.locator('tbody tr')).toHaveCount(3);
|
||||
await expect(result).toContainText('Sent to 3 workers');
|
||||
const runs = result.locator('.qc-run');
|
||||
await expect(runs).toHaveCount(3);
|
||||
for (const n of ['node-01', 'node-02', 'node-03']) {
|
||||
const card = runs.filter({ hasText: n });
|
||||
await expect(card.locator('.qc-run-status')).toHaveText(/Completed/);
|
||||
await expect(card.locator('pre.qc-out')).toHaveText(`${n} says hi`);
|
||||
}
|
||||
});
|
||||
|
||||
test('Executions updates live when a command starts elsewhere', async ({ page, request }) => {
|
||||
@@ -89,7 +101,7 @@ test('Quick Command remembers the mode and workers after a reload (#31)', async
|
||||
await boxes.filter({ hasText: 'node-03' }).locator('input').check();
|
||||
await page.locator('#qc-command').fill('true');
|
||||
await page.locator('#qc-execute-btn').click();
|
||||
await expect(page.locator('#qc-result')).toContainText(/2/);
|
||||
await expect(page.locator('#qc-result')).toContainText('Sent to 2 workers');
|
||||
|
||||
await page.reload();
|
||||
await expect(page.locator('#qc-mode-multi')).toBeChecked();
|
||||
@@ -103,7 +115,7 @@ test('Quick Command remembers the mode and workers after a reload (#31)', async
|
||||
await page.locator('#qc-worker').selectOption(node3);
|
||||
await page.locator('#qc-command').fill('true'); // the reload emptied it
|
||||
await page.locator('#qc-execute-btn').click();
|
||||
await expect(page.locator('#qc-result')).toContainText('Command sent successfully');
|
||||
await expect(page.locator('#qc-result .qc-run-status')).toHaveText(/Completed/);
|
||||
await page.reload();
|
||||
await expect(page.locator('#qc-mode-single')).toBeChecked();
|
||||
await expect(page.locator('#qc-worker option:checked')).toContainText('node-03');
|
||||
@@ -129,3 +141,28 @@ test('a live update keeps the rows brought in with Load More (#17)', async ({ pa
|
||||
await expect(rows.first()).toContainText(marker, { timeout: 10_000 });
|
||||
await expect(rows).toHaveCount(shown);
|
||||
});
|
||||
|
||||
test('the result still shows when the live update is missed (#5)', async ({ page }) => {
|
||||
// No live connection at all: the page has to find the result by polling.
|
||||
await page.routeWebSocket(/.*/, () => { /* never connects to the server */ });
|
||||
const marker = token();
|
||||
await page.goto('/quick');
|
||||
await page.locator('#qc-worker').selectOption({ label: 'node-03 (online)' });
|
||||
await page.locator('#qc-command').fill(`echo ${marker}`);
|
||||
await page.locator('#qc-execute-btn').click();
|
||||
|
||||
const result = page.locator('#qc-result');
|
||||
await expect(result.locator('.qc-run-status')).toHaveText(/Running/);
|
||||
await expect(result.locator('pre.qc-out')).toHaveText(marker, { timeout: 15_000 });
|
||||
await expect(result.locator('.qc-run-status')).toHaveText(/Completed/);
|
||||
});
|
||||
|
||||
test('only the worker picker for the chosen mode is shown', async ({ page }) => {
|
||||
await page.goto('/quick');
|
||||
await page.locator('#qc-mode-single').check();
|
||||
await expect(page.locator('#qc-single-mode')).toBeVisible();
|
||||
await expect(page.locator('#qc-multi-mode')).toBeHidden();
|
||||
await page.locator('#qc-mode-multi').check();
|
||||
await expect(page.locator('#qc-multi-mode')).toBeVisible();
|
||||
await expect(page.locator('#qc-single-mode')).toBeHidden();
|
||||
});
|
||||
Reference in new issue
Block a user