mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
populate on setup
This commit is contained in:
parent
4b68edbcf4
commit
fc07052d57
@ -44,17 +44,7 @@ const gitCommitInfoPlugin = (fullConfig: FullConfigInternal): TestRunnerPlugin =
|
|||||||
let config: FullConfig;
|
let config: FullConfig;
|
||||||
const configDir = fullConfig.configDir;
|
const configDir = fullConfig.configDir;
|
||||||
|
|
||||||
return {
|
async function updateMetdata() {
|
||||||
name: 'playwright:git-commit-info',
|
|
||||||
|
|
||||||
setup: async (cfg: FullConfig) => {
|
|
||||||
config = cfg;
|
|
||||||
},
|
|
||||||
|
|
||||||
begin: async () => {
|
|
||||||
if (!config)
|
|
||||||
throw new Error('Configuration is missing');
|
|
||||||
|
|
||||||
const metadata = config.metadata as MetadataWithCommitInfo;
|
const metadata = config.metadata as MetadataWithCommitInfo;
|
||||||
|
|
||||||
const ci = await ciInfo();
|
const ci = await ciInfo();
|
||||||
@ -80,6 +70,21 @@ const gitCommitInfoPlugin = (fullConfig: FullConfigInternal): TestRunnerPlugin =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let testRun = 0;
|
||||||
|
return {
|
||||||
|
name: 'playwright:git-commit-info',
|
||||||
|
|
||||||
|
setup: async (cfg: FullConfig) => {
|
||||||
|
config = cfg;
|
||||||
|
await updateMetdata();
|
||||||
|
},
|
||||||
|
|
||||||
|
begin: async () => {
|
||||||
|
testRun++;
|
||||||
|
if (testRun > 1)
|
||||||
|
await updateMetdata();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user