Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable smoke test on cra/default-ts #19352

Merged
merged 5 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ jobs:
at: .
- run:
name: Creating Sandboxes
command: yarn task --task create --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task create --template $(yarn get-template ci create) --force --no-before --junit
working_directory: code
- persist_to_workspace:
root: .
Expand All @@ -497,15 +497,15 @@ jobs:
executor:
class: medium+
name: sb_node_14_browsers
parallelism: 10
parallelism: 9
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Smoke Testing Sandboxes
command: yarn task --task smoke-test --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task smoke-test --template $(yarn get-template ci smoke-test) --force --no-before --junit
working_directory: code
- store_test_results:
path: code/test-results
Expand All @@ -521,7 +521,7 @@ jobs:
at: .
- run:
name: Building Sandboxes
command: yarn task --task build --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task build --template $(yarn get-template ci build) --force --no-before --junit
working_directory: code
- store_test_results:
path: code/test-results
Expand All @@ -541,7 +541,7 @@ jobs:
at: .
- run:
name: Running Test Runner
command: yarn task --task test-runner --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task test-runner --template $(yarn get-template ci test-runner) --force --no-before --junit
working_directory: code
- store_test_results:
path: code/test-results
Expand All @@ -557,7 +557,7 @@ jobs:
at: .
- run:
name: Running Chromatic
command: yarn task --task chromatic --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task chromatic --template $(yarn get-template ci chromatic) --force --no-before --junit
working_directory: code
- store_test_results:
path: code/test-results
Expand All @@ -573,7 +573,7 @@ jobs:
at: .
- run:
name: Running E2E Tests
command: yarn task --task e2e-tests --template $(yarn get-template ci) --force --no-before --junit
command: yarn task --task e2e-tests --template $(yarn get-template ci e2e-tests) --force --no-before --junit
working_directory: code
- store_test_results:
path: code/test-results
Expand Down
2 changes: 2 additions & 0 deletions code/lib/cli/src/repro-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const craTemplates = {
name: 'Create React App (Typescript)',
script: 'npx create-react-app . --template typescript',
cadence: ['ci', 'daily', 'weekly'],
// Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed.
skipTasks: ['smoke-test'],
expected: {
framework: '@storybook/cra',
renderer: '@storybook/react',
Expand Down
13 changes: 8 additions & 5 deletions scripts/get-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const sandboxDir = resolve(__dirname, '../sandbox');
export type Cadence = 'ci' | 'daily' | 'weekly';
export type Template = {
cadence?: readonly Cadence[];
skipScripts?: string[];
skipTasks?: string[];
// there are other fields but we don't use them here
};
export type TemplateKey = string;
export type TemplateKey = keyof typeof TEMPLATES;
export type Templates = Record<TemplateKey, Template>;

async function getDirectories(source: string) {
Expand All @@ -34,18 +34,21 @@ export async function getTemplate(
(templateKey) => templateKey.replace('/', '-') === dirName
);
})
.filter(Boolean);
.filter(Boolean) as TemplateKey[];
}

if (potentialTemplateKeys.length === 0) {
const allTemplates = Object.entries(TEMPLATES as Templates);
const cadenceTemplates = allTemplates.filter(([, template]) =>
template.cadence.includes(cadence)
);
const jobTemplates = cadenceTemplates.filter(([, t]) => !t.skipScripts?.includes(scriptName));
potentialTemplateKeys = jobTemplates.map(([k]) => k);
potentialTemplateKeys = cadenceTemplates.map(([k]) => k) as TemplateKey[];
}

potentialTemplateKeys = potentialTemplateKeys.filter(
(t) => !(TEMPLATES[t] as Template).skipTasks?.includes(scriptName)
);

if (potentialTemplateKeys.length !== total) {
throw new Error(`Circle parallelism set incorrectly.

Expand Down