2021-06-06 17:09:53 -07:00
|
|
|
/**
|
|
|
|
* Copyright Microsoft Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-10-14 05:55:08 -04:00
|
|
|
import type { TestError } from '../types/testReporter';
|
2022-04-29 12:32:39 -08:00
|
|
|
import type { ConfigCLIOverrides } from './runner';
|
2022-05-03 13:25:56 -08:00
|
|
|
import type { TestStatus } from './types';
|
2021-06-06 17:09:53 -07:00
|
|
|
|
|
|
|
export type SerializedLoaderData = {
|
2022-04-29 15:05:08 -08:00
|
|
|
configFile: string | undefined;
|
|
|
|
configDir: string;
|
2022-05-03 13:25:56 -08:00
|
|
|
configCLIOverrides: ConfigCLIOverrides;
|
2021-06-06 17:09:53 -07:00
|
|
|
};
|
2022-04-29 15:05:08 -08:00
|
|
|
|
2021-06-06 17:09:53 -07:00
|
|
|
export type WorkerInitParams = {
|
|
|
|
workerIndex: number;
|
2021-11-01 10:37:34 -07:00
|
|
|
parallelIndex: number;
|
2021-06-06 17:09:53 -07:00
|
|
|
repeatEachIndex: number;
|
|
|
|
projectIndex: number;
|
|
|
|
loader: SerializedLoaderData;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TestBeginPayload = {
|
|
|
|
testId: string;
|
2021-07-18 17:40:59 -07:00
|
|
|
startWallTime: number; // milliseconds since unix epoch
|
2021-06-06 17:09:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TestEndPayload = {
|
|
|
|
testId: string;
|
|
|
|
duration: number;
|
|
|
|
status: TestStatus;
|
2022-02-02 19:33:51 -07:00
|
|
|
errors: TestError[];
|
2021-06-06 17:09:53 -07:00
|
|
|
expectedStatus: TestStatus;
|
|
|
|
annotations: { type: string, description?: string }[];
|
|
|
|
timeout: number;
|
2021-07-16 13:48:37 -07:00
|
|
|
attachments: { name: string, path?: string, body?: string, contentType: string }[];
|
2021-06-06 17:09:53 -07:00
|
|
|
};
|
|
|
|
|
2021-08-02 17:17:20 -07:00
|
|
|
export type StepBeginPayload = {
|
2021-07-30 16:07:02 -07:00
|
|
|
testId: string;
|
2021-08-02 17:17:20 -07:00
|
|
|
stepId: string;
|
|
|
|
title: string;
|
|
|
|
category: string;
|
2021-09-15 11:34:23 -07:00
|
|
|
canHaveChildren: boolean;
|
2021-09-16 15:51:27 -07:00
|
|
|
forceNoParent: boolean;
|
2021-08-02 17:17:20 -07:00
|
|
|
wallTime: number; // milliseconds since unix epoch
|
2021-10-18 20:06:18 -08:00
|
|
|
location?: { file: string, line: number, column: number };
|
2021-08-02 17:17:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export type StepEndPayload = {
|
|
|
|
testId: string;
|
|
|
|
stepId: string;
|
2022-03-30 20:52:00 -08:00
|
|
|
refinedTitle?: string;
|
2021-08-02 17:17:20 -07:00
|
|
|
wallTime: number; // milliseconds since unix epoch
|
|
|
|
error?: TestError;
|
2021-07-30 16:07:02 -07:00
|
|
|
};
|
|
|
|
|
2021-06-06 17:09:53 -07:00
|
|
|
export type TestEntry = {
|
|
|
|
testId: string;
|
|
|
|
retry: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type RunPayload = {
|
|
|
|
file: string;
|
|
|
|
entries: TestEntry[];
|
|
|
|
};
|
|
|
|
|
|
|
|
export type DonePayload = {
|
2022-02-23 12:32:12 -08:00
|
|
|
fatalErrors: TestError[];
|
2022-03-08 20:29:31 -08:00
|
|
|
skipTestsDueToSetupFailure: string[]; // test ids
|
2022-04-25 09:05:40 -07:00
|
|
|
fatalUnknownTestIds?: string[];
|
2021-06-06 17:09:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TestOutputPayload = {
|
|
|
|
testId?: string;
|
|
|
|
text?: string;
|
|
|
|
buffer?: string;
|
|
|
|
};
|
2022-02-23 12:32:12 -08:00
|
|
|
|
|
|
|
export type TeardownErrorsPayload = {
|
|
|
|
fatalErrors: TestError[];
|
|
|
|
};
|