From 489c692a68bcb25cef0e0e69ef7418714ab9387b Mon Sep 17 00:00:00 2001 From: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com> Date: Tue, 12 Nov 2024 19:53:52 -0500 Subject: [PATCH] exclude windows from running concurrently --- packages/adders/_tests/all-addons/test.ts | 6 ++--- packages/adders/_tests/storybook/test.ts | 32 ++++++++++++++--------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/adders/_tests/all-addons/test.ts b/packages/adders/_tests/all-addons/test.ts index 4d974f65..934b3da1 100644 --- a/packages/adders/_tests/all-addons/test.ts +++ b/packages/adders/_tests/all-addons/test.ts @@ -1,12 +1,12 @@ -// import process from 'node:process'; +import process from 'node:process'; import { expect } from '@playwright/test'; import { setupTest } from '../_setup/suite.ts'; import { officialAdders } from '../../index.ts'; import type { AddonMap, OptionMap } from 'sv'; -// const windowsCI = process.env.CI && process.platform === 'win32'; +const windowsCI = process.env.CI && process.platform === 'win32'; const addons = officialAdders.reduce((addonMap, addon) => { - // if (addon.id === 'storybook' && windowsCI) return addonMap; + if (addon.id === 'storybook' && windowsCI) return addonMap; addonMap[addon.id] = addon; return addonMap; }, {}); diff --git a/packages/adders/_tests/storybook/test.ts b/packages/adders/_tests/storybook/test.ts index 903f41df..8a9e0258 100644 --- a/packages/adders/_tests/storybook/test.ts +++ b/packages/adders/_tests/storybook/test.ts @@ -1,3 +1,4 @@ +import process from 'node:process'; import { expect } from '@playwright/test'; import { setupTest } from '../_setup/suite.ts'; import storybook from '../../storybook/index.ts'; @@ -6,18 +7,23 @@ const { test, variants, prepareServer } = setupTest({ storybook }); let port = 6006; -test.for(variants)('storybook loaded - %s', async (variant, { page, ...ctx }) => { - const cwd = await ctx.run(variant, { storybook: {} }); +const windowsCI = process.env.CI && process.platform === 'win32'; +test.for(variants)( + 'storybook loaded - %s', + { concurrent: !windowsCI }, + async (variant, { page, ...ctx }) => { + const cwd = await ctx.run(variant, { storybook: {} }); - const { close } = await prepareServer({ - cwd, - page, - previewCommand: `pnpm storybook -p ${++port} --ci`, - buildCommand: '' - }); - // kill server process when we're done - ctx.onTestFinished(async () => await close()); + const { close } = await prepareServer({ + cwd, + page, + previewCommand: `pnpm storybook -p ${++port} --ci`, + buildCommand: '' + }); + // kill server process when we're done + ctx.onTestFinished(async () => await close()); - expect(await page.$('main .sb-bar')).toBeTruthy(); - expect(await page.$('#storybook-preview-wrapper')).toBeTruthy(); -}); + expect(await page.$('main .sb-bar')).toBeTruthy(); + expect(await page.$('#storybook-preview-wrapper')).toBeTruthy(); + } +);