chore: move testInfo and timeoutManager to worker/ (#20803)
This commit is contained in:
parent
4469e57695
commit
ab4cd83e44
|
|
@ -1,8 +1,9 @@
|
||||||
[*]
|
[*]
|
||||||
../common/
|
|
||||||
../matchers/
|
|
||||||
../util.ts
|
../util.ts
|
||||||
../utilsBundle.ts
|
../utilsBundle.ts
|
||||||
|
|
||||||
[transform.ts]
|
[transform.ts]
|
||||||
../third_party/tsconfig-loader.ts
|
../third_party/tsconfig-loader.ts
|
||||||
|
|
||||||
|
[testType.ts]
|
||||||
|
../matchers/expect.ts
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { TestInfoImpl } from './testInfo';
|
import type { TestInfoImpl } from '../worker/testInfo';
|
||||||
import type { Suite } from './test';
|
import type { Suite } from './test';
|
||||||
|
|
||||||
let currentTestInfoValue: TestInfoImpl | null = null;
|
let currentTestInfoValue: TestInfoImpl | null = null;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Fixtures, TestInfoError, Project } from '../../types/test';
|
import type { Fixtures, Project } from '../../types/test';
|
||||||
import type { Location } from '../../types/testReporter';
|
import type { Location } from '../../types/testReporter';
|
||||||
import type { TestRunnerPluginRegistration } from '../plugins';
|
import type { TestRunnerPluginRegistration } from '../plugins';
|
||||||
import type { Matcher } from '../util';
|
import type { Matcher } from '../util';
|
||||||
|
|
@ -29,16 +29,6 @@ export type FixturesWithLocation = {
|
||||||
};
|
};
|
||||||
export type Annotation = { type: string, description?: string };
|
export type Annotation = { type: string, description?: string };
|
||||||
|
|
||||||
export interface TestStepInternal {
|
|
||||||
complete(result: { error?: Error | TestInfoError }): void;
|
|
||||||
title: string;
|
|
||||||
category: string;
|
|
||||||
canHaveChildren: boolean;
|
|
||||||
forceNoParent: boolean;
|
|
||||||
location?: Location;
|
|
||||||
refinedTitle?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type ConfigInternal = {
|
type ConfigInternal = {
|
||||||
globalOutputDir: string;
|
globalOutputDir: string;
|
||||||
configDir: string;
|
configDir: string;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import type { APIRequestContext, BrowserContext, BrowserContextOptions, LaunchOp
|
||||||
import * as playwrightLibrary from 'playwright-core';
|
import * as playwrightLibrary from 'playwright-core';
|
||||||
import { createGuid, debugMode, removeFolders, addStackIgnoreFilter } from 'playwright-core/lib/utils';
|
import { createGuid, debugMode, removeFolders, addStackIgnoreFilter } from 'playwright-core/lib/utils';
|
||||||
import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, ScreenshotMode, TestInfo, TestType, TraceMode, VideoMode } from '../types/test';
|
import type { Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, ScreenshotMode, TestInfo, TestType, TraceMode, VideoMode } from '../types/test';
|
||||||
import type { TestInfoImpl } from './common/testInfo';
|
import type { TestInfoImpl } from './worker/testInfo';
|
||||||
import { rootTestType } from './common/testType';
|
import { rootTestType } from './common/testType';
|
||||||
import { type ContextReuseMode } from './common/types';
|
import { type ContextReuseMode } from './common/types';
|
||||||
export { expect } from './matchers/expect';
|
export { expect } from './matchers/expect';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
[*]
|
[*]
|
||||||
../common/
|
../common/
|
||||||
../expect.ts
|
|
||||||
../globals.ts
|
|
||||||
../testInfo.ts
|
|
||||||
../util.ts
|
../util.ts
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { colors } from 'playwright-core/lib/utilsBundle';
|
||||||
import type { Expect } from '../common/types';
|
import type { Expect } from '../common/types';
|
||||||
import { expectTypes, callLogText } from '../util';
|
import { expectTypes, callLogText } from '../util';
|
||||||
import { currentTestInfo } from '../common/globals';
|
import { currentTestInfo } from '../common/globals';
|
||||||
import type { TestInfoErrorState } from '../common/testInfo';
|
import type { TestInfoErrorState } from '../worker/testInfo';
|
||||||
import { toBeTruthy } from './toBeTruthy';
|
import { toBeTruthy } from './toBeTruthy';
|
||||||
import { toEqual } from './toEqual';
|
import { toEqual } from './toEqual';
|
||||||
import { toExpectedTextValues, toMatchText } from './toMatchText';
|
import { toExpectedTextValues, toMatchText } from './toMatchText';
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import { colors } from 'playwright-core/lib/utilsBundle';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { mime } from 'playwright-core/lib/utilsBundle';
|
import { mime } from 'playwright-core/lib/utilsBundle';
|
||||||
import type { TestInfoImpl } from '../common/testInfo';
|
import type { TestInfoImpl } from '../worker/testInfo';
|
||||||
import type { SyncExpectationResult } from './expect';
|
import type { SyncExpectationResult } from './expect';
|
||||||
|
|
||||||
type NameOrSegments = string | string[];
|
type NameOrSegments = string | string[];
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
[*]
|
[*]
|
||||||
../common/
|
../common/
|
||||||
../babelBundle.ts
|
|
||||||
../test.ts
|
|
||||||
../util.ts
|
../util.ts
|
||||||
../utilsBundle.ts
|
../utilsBundle.ts
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
[*]
|
[*]
|
||||||
../../types.ts
|
../../types.ts
|
||||||
../common/
|
../common/
|
||||||
../matchers/
|
|
||||||
../reporters/
|
../reporters/
|
||||||
../third_party/
|
../third_party/
|
||||||
../plugins/
|
../plugins/
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
import { formatLocation, debugTest } from '../util';
|
import { formatLocation, debugTest } from '../util';
|
||||||
import type { Location, WorkerInfo } from '../common/types';
|
import type { Location, WorkerInfo } from '../common/types';
|
||||||
import { ManualPromise } from 'playwright-core/lib/utils';
|
import { ManualPromise } from 'playwright-core/lib/utils';
|
||||||
import type { TestInfoImpl } from '../common/testInfo';
|
import type { TestInfoImpl } from './testInfo';
|
||||||
import type { FixtureDescription, TimeoutManager } from '../common/timeoutManager';
|
import type { FixtureDescription, TimeoutManager } from './timeoutManager';
|
||||||
import { fixtureParameterNames, type FixturePool, type FixtureRegistration, type FixtureScope } from '../common/fixtures';
|
import { fixtureParameterNames, type FixturePool, type FixtureRegistration, type FixtureScope } from '../common/fixtures';
|
||||||
|
|
||||||
class Fixture {
|
class Fixture {
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@ import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { monotonicTime } from 'playwright-core/lib/utils';
|
import { monotonicTime } from 'playwright-core/lib/utils';
|
||||||
import type { TestInfoError, TestInfo, TestStatus } from '../../types/test';
|
import type { TestInfoError, TestInfo, TestStatus } from '../../types/test';
|
||||||
import type { StepBeginPayload, StepEndPayload, WorkerInitParams } from './ipc';
|
import type { StepBeginPayload, StepEndPayload, WorkerInitParams } from '../common/ipc';
|
||||||
import type { TestCase } from './test';
|
import type { TestCase } from '../common/test';
|
||||||
import { TimeoutManager } from './timeoutManager';
|
import { TimeoutManager } from './timeoutManager';
|
||||||
import type { Annotation, FullConfigInternal, FullProjectInternal, TestStepInternal } from './types';
|
import type { Annotation, FullConfigInternal, FullProjectInternal, Location } from '../common/types';
|
||||||
import { getContainedPath, normalizeAndSaveAttachment, sanitizeForFilePath, serializeError, trimLongString } from '../util';
|
import { getContainedPath, normalizeAndSaveAttachment, sanitizeForFilePath, serializeError, trimLongString } from '../util';
|
||||||
|
|
||||||
export type TestInfoErrorState = {
|
export type TestInfoErrorState = {
|
||||||
|
|
@ -30,6 +30,16 @@ export type TestInfoErrorState = {
|
||||||
hasHardError: boolean,
|
hasHardError: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
interface TestStepInternal {
|
||||||
|
complete(result: { error?: Error | TestInfoError }): void;
|
||||||
|
title: string;
|
||||||
|
category: string;
|
||||||
|
canHaveChildren: boolean;
|
||||||
|
forceNoParent: boolean;
|
||||||
|
location?: Location;
|
||||||
|
refinedTitle?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class TestInfoImpl implements TestInfo {
|
export class TestInfoImpl implements TestInfo {
|
||||||
private _onStepBegin: (payload: StepBeginPayload) => void;
|
private _onStepBegin: (payload: StepBeginPayload) => void;
|
||||||
private _onStepEnd: (payload: StepEndPayload) => void;
|
private _onStepEnd: (payload: StepEndPayload) => void;
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
import { colors } from 'playwright-core/lib/utilsBundle';
|
import { colors } from 'playwright-core/lib/utilsBundle';
|
||||||
import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils';
|
import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils';
|
||||||
import type { Location, TestInfoError } from './types';
|
import type { Location, TestInfoError } from '../common/types';
|
||||||
|
|
||||||
export type TimeSlot = {
|
export type TimeSlot = {
|
||||||
timeout: number;
|
timeout: number;
|
||||||
|
|
@ -24,9 +24,8 @@ import type { Suite, TestCase } from '../common/test';
|
||||||
import type { Annotation, FullConfigInternal, FullProjectInternal, TestInfoError } from '../common/types';
|
import type { Annotation, FullConfigInternal, FullProjectInternal, TestInfoError } from '../common/types';
|
||||||
import { FixtureRunner } from './fixtureRunner';
|
import { FixtureRunner } from './fixtureRunner';
|
||||||
import { ManualPromise } from 'playwright-core/lib/utils';
|
import { ManualPromise } from 'playwright-core/lib/utils';
|
||||||
import { TestInfoImpl } from '../common/testInfo';
|
import { TestInfoImpl } from './testInfo';
|
||||||
import type { TimeSlot } from '../common/timeoutManager';
|
import { TimeoutManager, type TimeSlot } from './timeoutManager';
|
||||||
import { TimeoutManager } from '../common/timeoutManager';
|
|
||||||
import { ProcessRunner } from '../common/process';
|
import { ProcessRunner } from '../common/process';
|
||||||
import { loadTestFile } from '../common/testLoader';
|
import { loadTestFile } from '../common/testLoader';
|
||||||
import { buildFileSuiteForProject, filterTestsRemoveEmptySuites } from '../common/suiteUtils';
|
import { buildFileSuiteForProject, filterTestsRemoveEmptySuites } from '../common/suiteUtils';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue