Skip to content

Commit

Permalink
skip certain test when testing ssv6
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Feb 6, 2023
1 parent 60d9535 commit ae900da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
10 changes: 8 additions & 2 deletions code/e2e-tests/addon-docs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable jest/valid-title */
/* eslint-disable jest/no-disabled-tests */
/* eslint-disable no-await-in-loop */
import { test, expect } from '@playwright/test';
import process from 'process';
import { SbPage } from './util';

const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME || '';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME || 'internal/ssv6-vite';

test.describe('addon-docs', () => {
test.beforeEach(async ({ page }) => {
Expand All @@ -16,7 +17,6 @@ test.describe('addon-docs', () => {
test('should provide source snippet', async ({ page }) => {
// templateName is e.g. 'Vue-CLI (Default JS)'
test.skip(
// eslint-disable-next-line jest/valid-title
/^(vue3|vue-cli|preact)/i.test(`${templateName}`),
`Skipping ${templateName}, which does not support dynamic source snippets`
);
Expand Down Expand Up @@ -54,6 +54,12 @@ test.describe('addon-docs', () => {
});

test('should order entries correctly', async ({ page }) => {
// TODO: This is broken in SSV6 Webpack. Context: https://github.com/storybookjs/storybook/issues/20941
test.skip(
templateName.includes('ssv6-webpack'),
`${templateName} fails because of a known issue: https://github.com/storybookjs/storybook/issues/20941`
);

const sbPage = new SbPage(page);
await sbPage.navigateToStory('addons/docs/docspage/basic', 'docs');

Expand Down
8 changes: 8 additions & 0 deletions code/e2e-tests/json-files.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/* eslint-disable jest/no-disabled-tests */
import { test, expect } from '@playwright/test';
import process from 'process';

const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';
const templateName = process.env.STORYBOOK_TEMPLATE_NAME;

test.describe('JSON files', () => {
test.skip(
// eslint-disable-next-line jest/valid-title
templateName.includes('ssv6'),
'Only run this test for Sandboxes with StoryStoreV7 enabled'
);

test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);
});
Expand Down
10 changes: 8 additions & 2 deletions scripts/tasks/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ export const testRunner: Task = {
async ready() {
return false;
},
async run({ sandboxDir, junitFilename }, { dryRun, debug }) {
async run({ sandboxDir, junitFilename, template }, { dryRun, debug }) {
const execOptions = { cwd: sandboxDir };
const flags = [`--url http://localhost:${PORT}`, '--junit', '--maxWorkers=2'];

// index-json mode is only supported in ssv7
if (template.modifications?.mainConfig?.features?.storyStoreV7 !== false) {
flags.push('--index-json');
}

await exec(
`yarn test-storybook --url http://localhost:${PORT} --junit --index-json --maxWorkers=2`,
`yarn test-storybook ${flags.join(' ')}`,
{
...execOptions,
env: {
Expand Down

0 comments on commit ae900da

Please sign in to comment.