chore: provisional fix for win install test failure (#29175)

This commit is contained in:
Pavel Feldman 2024-01-25 11:46:30 -08:00 committed by GitHub
parent b5e175e6e2
commit 24ff2e2bad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ export async function runDevServer(configFile: string, registerSourceFile: strin
const componentRegistry: ComponentRegistry = new Map(); const componentRegistry: ComponentRegistry = new Map();
await populateComponentsFromTests(componentRegistry); await populateComponentsFromTests(componentRegistry);
const dirs = resolveDirs(config.configDir, config.config); const dirs = await resolveDirs(config.configDir, config.config);
const registerSource = injectedSource + '\n' + await fs.promises.readFile(registerSourceFile, 'utf-8'); const registerSource = injectedSource + '\n' + await fs.promises.readFile(registerSourceFile, 'utf-8');
const viteConfig = await createConfig(dirs, config.config, frameworkPluginFactory, false); const viteConfig = await createConfig(dirs, config.config, frameworkPluginFactory, false);
viteConfig.plugins.push({ viteConfig.plugins.push({

View file

@ -64,7 +64,7 @@ export function createPlugin(
} }
} }
const dirs = resolveDirs(configDir, config); const dirs = await resolveDirs(configDir, config);
const buildInfoFile = path.join(dirs.outDir, 'metainfo.json'); const buildInfoFile = path.join(dirs.outDir, 'metainfo.json');
let buildExists = false; let buildExists = false;

View file

@ -38,13 +38,13 @@ export type ComponentDirs = {
templateDir: string; templateDir: string;
}; };
export function resolveDirs(configDir: string, config: FullConfig): ComponentDirs { export async function resolveDirs(configDir: string, config: FullConfig): Promise<ComponentDirs> {
const use = config.projects[0].use as CtConfig; const use = config.projects[0].use as CtConfig;
// FIXME: use build plugin to determine html location to resolve this. // FIXME: use build plugin to determine html location to resolve this.
// TemplateDir must be relative, otherwise we can't move the final index.html into its target location post-build. // TemplateDir must be relative, otherwise we can't move the final index.html into its target location post-build.
// This regressed in https://github.com/microsoft/playwright/pull/26526 // This regressed in https://github.com/microsoft/playwright/pull/26526
const relativeTemplateDir = use.ctTemplateDir || 'playwright'; const relativeTemplateDir = use.ctTemplateDir || 'playwright';
const templateDir = path.join(configDir, relativeTemplateDir); const templateDir = await fs.promises.realpath(path.normalize(path.join(configDir, relativeTemplateDir)));
const outDir = use.ctCacheDir ? path.resolve(configDir, use.ctCacheDir) : path.resolve(templateDir, '.cache'); const outDir = use.ctCacheDir ? path.resolve(configDir, use.ctCacheDir) : path.resolve(templateDir, '.cache');
return { return {
configDir, configDir,