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

Core: Generate manager cache in smoke test, but don't use/clear any cache #13784

Merged
merged 3 commits into from Feb 1, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/core/src/server/dev-server.ts
Expand Up @@ -237,18 +237,18 @@ const startManager = async ({
logConfig('Manager webpack config', managerConfig);
}

if (options.cache && !options.smokeTest) {
if (options.cache) {
if (options.managerCache) {
const [useCache, hasOutput] = await Promise.all([
// must run even if outputDir doesn't exist, otherwise the 2nd run won't use cache
useManagerCache(options.cache, managerConfig),
pathExists(outputDir),
]);
if (useCache && hasOutput) {
if (useCache && hasOutput && !options.smokeTest) {
logger.info('=> Using cached manager');
managerConfig = null;
}
} else if (await clearManagerCache(options.cache)) {
} else if (!options.smokeTest && (await clearManagerCache(options.cache))) {
logger.info('=> Cleared cached manager config');
}
}
Expand Down Expand Up @@ -413,14 +413,14 @@ export async function storybookDevServer(options: any) {
startManager({ startTime, options, configType, outputDir, configDir, prebuiltDir })
// TODO #13083 Restore this when compiling the preview is fast enough
// .then((result) => {
// if (!options.ci) openInBrowser(address);
// if (!options.ci && !options.smokeTest) openInBrowser(address);
// return result;
// })
.catch(bailPreview),
]);

// TODO #13083 Remove this when compiling the preview is fast enough
if (!options.ci) openInBrowser(networkAddress);
if (!options.ci && !options.smokeTest) openInBrowser(networkAddress);

return { ...previewResult, ...managerResult, address, networkAddress };
}