From cf661db4cecaf7dfe5243e81718969fbc3ffb794 Mon Sep 17 00:00:00 2001 From: Zacharias Fragkiadakis Date: Sat, 4 Jan 2025 11:11:06 +0200 Subject: [PATCH] test(e2e): add test skipping method - Allows skipping tests based on platform by include `@skip{platform}CI` in the test name Signed-off-by: Zacharias Fragkiadakis --- test/e2e/wdio.conf.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e/wdio.conf.ts b/test/e2e/wdio.conf.ts index 7e697795..b69c9e65 100644 --- a/test/e2e/wdio.conf.ts +++ b/test/e2e/wdio.conf.ts @@ -13,6 +13,17 @@ if (!process.env['CI']) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access const vscodeVersion = (packageJson.engines.vscode as string).replace(/^\^/, '') +const skipTestsGrep = [] + +switch (process.platform) { + case 'darwin': + skipTestsGrep.push('@skipMacOSCI') + break + case 'linux': + skipTestsGrep.push('@skipLinuxCI') + break +} + // TODO: Bump webdriverio to v9 once wdio-vscode-service supports it // Relevant PR: https://github.com/webdriverio-community/wdio-vscode-service/pull/130 // Relevant Issue: https://github.com/webdriverio-community/wdio-vscode-service/issues/140 @@ -52,6 +63,8 @@ export const config: Options.Testrunner = { mochaOpts: { ui: 'bdd', timeout: 60000, + grep: skipTestsGrep.length > 0 ? skipTestsGrep.join('|') : undefined, + invert: true, }, onPrepare: async () => { await $`mkdir -p ${path.join(rootDirPath, 'node_modules/.cache/wdio')}`