From 4aed3acbd7450cc12b1c77a94c6e19e1b77e2536 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Fri, 4 Apr 2025 12:56:38 +0530 Subject: [PATCH] playwright: add debug log in case of ingestion pipeline failure. (#20600) * debug dbt test * failed status * Refactor: Update ServiceIngestion tests and logging mechanism - Removed the testMatch for ServiceIngestion.spec.ts in playwright.config.ts. - Updated ServiceIngestion.spec.ts to include additional ingestion classes and improved the handling of failed pipeline logs by fetching logs via API instead of using the clipboard. - Enhanced logging for failed pipelines to provide clearer output in the console. * minor change --- .../support/entity/ingestion/ServiceBaseClass.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts index eae995056fd..ea6ffe65f1d 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts @@ -351,6 +351,21 @@ class ServiceBaseClass { await page.waitForLoadState('networkidle'); await page.waitForSelector(`td:has-text("${ingestionType}")`); + const pipelineStatus = await page + .locator(`[data-row-key*="${workflowData.name}"]`) + .getByTestId('pipeline-status') + .last() + .textContent(); + // add logs to console for failed pipelines + if (pipelineStatus?.toLowerCase() === 'failed') { + const logsResponse = await apiContext + .get(`/api/v1/services/ingestionPipelines/logs/${workflowData.id}/last`) + .then((res) => res.json()); + + // eslint-disable-next-line no-console + console.log(logsResponse); + } + await expect( page .locator(`[data-row-key*="${workflowData.name}"]`)