From 642608a06482a0b3d848907d3bd36d4bffb106aa Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 3 Oct 2023 08:05:56 +0530 Subject: [PATCH] test: logs Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/setup/index.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/playwright/setup/index.ts b/tests/playwright/setup/index.ts index 75c8709deb..19856adb27 100644 --- a/tests/playwright/setup/index.ts +++ b/tests/playwright/setup/index.ts @@ -209,6 +209,8 @@ async function localInit({ // console.log(process.env.TEST_WORKER_INDEX, process.env.TEST_PARALLEL_INDEX); + console.timeLog('Setup', '2'); + if (isEE() && api['workspace']) { // Delete associated workspace // Note that: on worker error, entire thread is reset & worker ID numbering is reset too @@ -259,7 +261,7 @@ async function localInit({ } } - console.time('Reset Sakila DB'); + console.timeLog('Setup', '3'); // DB reset if (dbType === 'pg' && !isEmptyProject) { @@ -285,7 +287,8 @@ async function localInit({ await resetSakilaMysql(nc_knex, parallelId, isEmptyProject); } } - console.timeEnd('Reset Sakila DB'); + + console.log('Setup', '4'); let workspace; if (isEE() && api['workspace']) { @@ -331,6 +334,8 @@ async function localInit({ } } + console.log('Setup', '5'); + // get current user information const user = await api.auth.me(); return { data: { base, user, workspace, token }, status: 200 }; @@ -353,6 +358,8 @@ const setup = async ({ isSuperUser?: boolean; url?: string; }): Promise => { + console.time('Setup'); + let dbType = process.env.CI ? process.env.E2E_DB_TYPE : process.env.E2E_DEV_DB_TYPE; dbType = dbType || (isEE() ? 'pg' : 'sqlite'); @@ -378,6 +385,8 @@ const setup = async ({ console.error(`Error resetting base: ${process.env.TEST_PARALLEL_INDEX}`, e); } + console.timeLog('Setup', 'Reset DB'); + if (response.status !== 200 || !response.data?.token || !response.data?.base) { console.error('Failed to reset test data', response.data, response.status, dbType); throw new Error('Failed to reset test data'); @@ -446,6 +455,7 @@ const setup = async ({ } await page.goto(baseUrl, { waitUntil: 'networkidle' }); + console.timeEnd('Setup'); return { base, token,