Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
{/snippet}

{#snippet tableMultiConnectorCell(data: AggregatedInputEndpointMetrics, isExpanded: boolean)}
{@const runningCount = data.connectors.filter((c) => c.paused === false).length}
{@const runningCount = data.connectors.filter((c) => c.paused === false && c.metrics.end_of_input === false).length}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior change without tests. The combined row icon now treats end-of-input connectors as non-running. This is testable with the existing accumulatePipelineMetrics test infrastructure in MetricsTables.svelte.spec.ts. A test case: two connectors -- one paused: false, end_of_input: true and one paused: false, end_of_input: false -- the combined icon should show running (not paused).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will take me a few hours to figure out how to write and run tests for the UI.

{@const anyErrors = data.connectors.some(inputHasErrors)}
{@const anyFatalError = data.connectors.some((c) => c.fatal_error != null)}
{@const anyBarrier = data.connectors.some((c) => c.barrier === true)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,26 @@ describe('MetricsTables.svelte', () => {
await renderComponent(buildMetrics(status))
await expect.element(page.getByText('3 connectors')).toBeInTheDocument()
})

it('combined row shows paused icon (not running) when one connector is end-of-input and the other is paused', async () => {
const status = makeStatus(
[],
[
makeInputStatus('t1', {
endpoint_name: 'c1',
paused: false,
metrics: makeInputMetrics({ end_of_input: true })
}),
makeInputStatus('t1', {
endpoint_name: 'c2',
paused: true
})
]
)
await renderComponent(buildMetrics(status))
await expect.element(page.getByTestId('box-icon-paused')).toBeInTheDocument()
await expect.element(page.getByTestId('box-icon-running')).not.toBeInTheDocument()
})
})

describe('F. Error count buttons & callbacks', () => {
Expand Down
Loading