use markdown-first way and inverse deps
This commit is contained in:
parent
9cd33a752d
commit
2a7ec73ad0
|
|
@ -64,6 +64,12 @@ See [`property: TestConfig.maxFailures`].
|
|||
|
||||
See [`property: TestConfig.metadata`].
|
||||
|
||||
## property: FullConfig.populateGitInfo
|
||||
* since: v1.50
|
||||
- type: <[boolean]>
|
||||
|
||||
See [`property: TestConfig.populateGitInfo`].
|
||||
|
||||
## property: FullConfig.preserveOutput
|
||||
* since: v1.10
|
||||
- type: <[PreserveOutput]<"always"|"never"|"failures-only">>
|
||||
|
|
|
|||
|
|
@ -321,6 +321,22 @@ This path will serve as the base directory for each test file snapshot directory
|
|||
## property: TestConfig.snapshotPathTemplate = %%-test-config-snapshot-path-template-%%
|
||||
* since: v1.28
|
||||
|
||||
## property: TestConfig.populateGitInfo
|
||||
* since: v1.50
|
||||
- type: ?<[boolean]>
|
||||
|
||||
Whether to populate [`property: TestConfig.metadata`] with Git info.
|
||||
|
||||
**Usage**
|
||||
|
||||
```js title="playwright.config.ts"
|
||||
import { defineConfig } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
populateGitInfo: !!process.env.CI,
|
||||
});
|
||||
```
|
||||
|
||||
## property: TestConfig.preserveOutput
|
||||
* since: v1.10
|
||||
- type: ?<[PreserveOutput]<"always"|"never"|"failures-only">>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import os from 'os';
|
|||
import type { Config, Fixtures, Project, ReporterDescription } from '../../types/test';
|
||||
import type { Location } from '../../types/testReporter';
|
||||
import type { TestRunnerPluginRegistration } from '../plugins';
|
||||
import { gitCommitInfo } from '../plugins/gitCommitInfoPlugin';
|
||||
import { getPackageJsonPath, mergeObjects } from '../util';
|
||||
import type { Matcher } from '../util';
|
||||
import type { ConfigCLIOverrides } from './ipc';
|
||||
|
|
@ -136,9 +135,6 @@ export class FullConfigInternal {
|
|||
this.webServers = [];
|
||||
}
|
||||
|
||||
if (this.config.populateGitInfo)
|
||||
this.plugins.push({ factory: gitCommitInfo });
|
||||
|
||||
const projectConfigs = configCLIOverrides.projects || userConfig.projects || [userConfig];
|
||||
this.projects = projectConfigs.map(p => new FullProjectInternal(configDir, userConfig, this, p, this.configCLIOverrides, packageJsonDir));
|
||||
resolveProjectDependencies(this.projects);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,15 @@
|
|||
import { createGuid, spawnAsync } from 'playwright-core/lib/utils';
|
||||
import type { TestRunnerPlugin } from './';
|
||||
import type { FullConfig } from '../../types/testReporter';
|
||||
import type { FullConfigInternal } from '../common/config';
|
||||
|
||||
const GIT_OPERATIONS_TIMEOUT_MS = 1500;
|
||||
|
||||
export const addGitCommitInfoPlugin = (fullConfig: FullConfigInternal) => {
|
||||
if (fullConfig.config.populateGitInfo)
|
||||
fullConfig.plugins.push({ factory: gitCommitInfo });
|
||||
};
|
||||
|
||||
export const gitCommitInfo = (options?: GitCommitInfoPluginOptions): TestRunnerPlugin => {
|
||||
return {
|
||||
name: 'playwright:git-commit-info',
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
import type { FullResult, TestError } from '../../types/testReporter';
|
||||
import { webServerPluginsForConfig } from '../plugins/webServerPlugin';
|
||||
import { addGitCommitInfoPlugin } from '../plugins/gitCommitInfoPlugin';
|
||||
import { collectFilesForProject, filterProjects } from './projectUtils';
|
||||
import { createErrorCollectingReporter, createReporters } from './reporters';
|
||||
import { TestRun, createApplyRebaselinesTask, createClearCacheTask, createGlobalSetupTasks, createLoadTask, createPluginSetupTasks, createReportBeginTask, createRunTestsTasks, createStartDevServerTask, runTasks } from './tasks';
|
||||
|
|
@ -70,6 +71,8 @@ export class Runner {
|
|||
const config = this._config;
|
||||
const listOnly = config.cliListOnly;
|
||||
|
||||
addGitCommitInfoPlugin(config);
|
||||
|
||||
// Legacy webServer support.
|
||||
webServerPluginsForConfig(config).forEach(p => config.plugins.push({ factory: p }));
|
||||
|
||||
|
|
|
|||
5
packages/playwright/types/test.d.ts
vendored
5
packages/playwright/types/test.d.ts
vendored
|
|
@ -1294,7 +1294,8 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||
outputDir?: string;
|
||||
|
||||
/**
|
||||
* Whether to populate [metadata](https://playwright.dev/docs/api/class-testconfig#test-config-output-metadata) with Git info.
|
||||
* Whether to populate [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata)
|
||||
* with Git info.
|
||||
*
|
||||
* **Usage**
|
||||
*
|
||||
|
|
@ -1814,7 +1815,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||
metadata: Metadata;
|
||||
|
||||
/**
|
||||
* See [testConfig.populateGitInfo](https://playwright.dev/docs/api/class-testconfig#test-config-populategitinfo).
|
||||
* See [testConfig.populateGitInfo](https://playwright.dev/docs/api/class-testconfig#test-config-populate-git-info).
|
||||
*/
|
||||
populateGitInfo: boolean;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue