chore: remove FullConfig.failOnFlakyTests (#35541)

This commit is contained in:
Dmitry Gozman 2025-04-08 16:13:54 +00:00 committed by GitHub
parent 8beaf3c383
commit 0e964e2b99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 3 additions and 15 deletions

View File

@ -10,12 +10,6 @@ Resolved configuration which is accessible via [`property: TestInfo.config`] and
Path to the configuration file used to run the tests. The value is an empty string if no config file was used.
## property: FullConfig.failOnFlakyTests
* since: v1.52
- type: <[boolean]>
See [`property: TestConfig.failOnFlakyTests`].
## property: FullConfig.forbidOnly
* since: v1.10
- type: <[boolean]>

View File

@ -48,6 +48,7 @@ export class FullConfigInternal {
readonly projects: FullProjectInternal[] = [];
readonly singleTSConfigPath?: string;
readonly captureGitInfo: Config['captureGitInfo'];
readonly failOnFlakyTests: boolean;
cliArgs: string[] = [];
cliGrep: string | undefined;
cliGrepInvert: string | undefined;
@ -77,6 +78,7 @@ export class FullConfigInternal {
this.plugins = (privateConfiguration?.plugins || []).map((p: any) => ({ factory: p }));
this.singleTSConfigPath = pathResolve(configDir, userConfig.tsconfig);
this.captureGitInfo = userConfig.captureGitInfo;
this.failOnFlakyTests = takeFirst(configCLIOverrides.failOnFlakyTests, userConfig.failOnFlakyTests, false);
this.globalSetups = (Array.isArray(userConfig.globalSetup) ? userConfig.globalSetup : [userConfig.globalSetup]).map(s => resolveScript(s, configDir)).filter(script => script !== undefined);
this.globalTeardowns = (Array.isArray(userConfig.globalTeardown) ? userConfig.globalTeardown : [userConfig.globalTeardown]).map(s => resolveScript(s, configDir)).filter(script => script !== undefined);
@ -88,7 +90,6 @@ export class FullConfigInternal {
this.config = {
configFile: resolvedConfigFile,
rootDir: pathResolve(configDir, userConfig.testDir) || configDir,
failOnFlakyTests: takeFirst(configCLIOverrides.failOnFlakyTests, userConfig.failOnFlakyTests, false),
forbidOnly: takeFirst(configCLIOverrides.forbidOnly, userConfig.forbidOnly, false),
fullyParallel: takeFirst(configCLIOverrides.fullyParallel, userConfig.fullyParallel, false),
globalSetup: this.globalSetups[0] ?? null,

View File

@ -607,7 +607,6 @@ export class TeleTestResult implements reporterTypes.TestResult {
export type TeleFullProject = reporterTypes.FullProject;
export const baseFullConfig: reporterTypes.FullConfig = {
failOnFlakyTests: false,
forbidOnly: false,
fullyParallel: false,
globalSetup: null,

View File

@ -49,7 +49,7 @@ export class FailureTracker {
}
result(): 'failed' | 'passed' {
return this._hasWorkerErrors || this.hasReachedMaxFailures() || this.hasFailedTests() || (this._config.config.failOnFlakyTests && this.hasFlakyTests()) ? 'failed' : 'passed';
return this._hasWorkerErrors || this.hasReachedMaxFailures() || this.hasFailedTests() || (this._config.failOnFlakyTests && this.hasFlakyTests()) ? 'failed' : 'passed';
}
hasFailedTests() {

View File

@ -1930,12 +1930,6 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
configFile?: string;
/**
* See
* [testConfig.failOnFlakyTests](https://playwright.dev/docs/api/class-testconfig#test-config-fail-on-flaky-tests).
*/
failOnFlakyTests: boolean;
/**
* See [testConfig.forbidOnly](https://playwright.dev/docs/api/class-testconfig#test-config-forbid-only).
*/