Skip to content

Commit

Permalink
exclude windows from running concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Nov 13, 2024
1 parent 804caa2 commit 489c692
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/adders/_tests/all-addons/test.ts
Original file line number Diff line number Diff line change
@@ -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>((addonMap, addon) => {
// if (addon.id === 'storybook' && windowsCI) return addonMap;
if (addon.id === 'storybook' && windowsCI) return addonMap;
addonMap[addon.id] = addon;
return addonMap;
}, {});
Expand Down
32 changes: 19 additions & 13 deletions packages/adders/_tests/storybook/test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
}
);

0 comments on commit 489c692

Please sign in to comment.