From 37c9762342e39bcb06771e6392f056fe7991da80 Mon Sep 17 00:00:00 2001 From: KVNLS Date: Thu, 21 Sep 2023 14:02:43 +0200 Subject: [PATCH] fix: try to fix macos --- .../tests/fixtures/common.ts | 57 ++++++++++--------- .../tests/playwright.config.ts | 3 +- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/apps/ledger-live-desktop/tests/fixtures/common.ts b/apps/ledger-live-desktop/tests/fixtures/common.ts index 741216933818..8c6c85a668da 100644 --- a/apps/ledger-live-desktop/tests/fixtures/common.ts +++ b/apps/ledger-live-desktop/tests/fixtures/common.ts @@ -71,33 +71,36 @@ const test = base.extend({ // launch app const windowSize = { width: 1024, height: 768 }; - - const electronApp: ElectronApplication = await electron.launch({ - args: [ - `${path.join(__dirname, "../../.webpack/main.bundle.js")}`, - `--user-data-dir=${userdataDestinationPath}`, - // `--window-size=${window.width},${window.height}`, // FIXME: Doesn't work, window size can't be forced? - "--force-device-scale-factor=1", - "--disable-dev-shm-usage", - // "--use-gl=swiftshader" - "--no-sandbox", - "--enable-logging", - ], - recordVideo: { - dir: `${path.join(__dirname, "../artifacts/videos/")}`, - size: windowSize, // FIXME: no default value, it could come from viewport property in conf file but it's not the case - }, - env: { ...env, NODE_ENV: "development" }, - colorScheme: theme, - locale: lang, - executablePath: require("electron/index.js"), - timeout: 120000, - }); - - await use(electronApp); - - // close app - await electronApp.close(); + try { + const electronApp: ElectronApplication = await electron.launch({ + args: [ + `${path.join(__dirname, "../../.webpack/main.bundle.js")}`, + `--user-data-dir=${userdataDestinationPath}`, + // `--window-size=${window.width},${window.height}`, // FIXME: Doesn't work, window size can't be forced? + "--force-device-scale-factor=1", + "--disable-dev-shm-usage", + // "--use-gl=swiftshader" + "--no-sandbox", + "--enable-logging", + ], + recordVideo: { + dir: `${path.join(__dirname, "../artifacts/videos/")}`, + size: windowSize, // FIXME: no default value, it could come from viewport property in conf file but it's not the case + }, + env: { ...env, NODE_ENV: "development" }, + colorScheme: theme, + locale: lang, + executablePath: require("electron/index.js"), + timeout: 120000, + }); + + await use(electronApp); + + // close app + await electronApp.close(); + } catch (error) { + console.log(error); + } }, page: async ({ electronApp }, use) => { // app is ready diff --git a/apps/ledger-live-desktop/tests/playwright.config.ts b/apps/ledger-live-desktop/tests/playwright.config.ts index 94e0f7c43576..b58f69d1cb91 100644 --- a/apps/ledger-live-desktop/tests/playwright.config.ts +++ b/apps/ledger-live-desktop/tests/playwright.config.ts @@ -37,7 +37,8 @@ const config: PlaywrightTestConfig = { preserveOutput: process.env.CI ? "failures-only" : "always", maxFailures: process.env.CI ? 5 : undefined, reportSlowTests: process.env.CI ? { max: 0, threshold: 60000 } : null, - workers: process.env.CI ? 1 : 1, // NOTE: 'macos-latest' and 'windows-latest' can't run 3 concurrent workers + fullyParallel: true, + workers: "50%", // NOTE: 'macos-latest' and 'windows-latest' can't run 3 concurrent workers retries: process.env.CI ? 2 : 0, // FIXME: --update-snapshots doesn't work with --retries reporter: process.env.CI ? [