Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
114 lines (102 loc) · 2.98 KB
/
Copy pathtypes.ts
File metadata and controls
114 lines (102 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {
CancellationToken,
Event,
TestController,
TestItem,
TestRun,
TestRunProfileKind,
Uri,
WorkspaceFolder,
} from 'vscode';
import { TestDiscoveryOptions } from '../../common/types';
export type TestRunInstanceOptions = TestRunOptions & {
exclude?: TestItem[];
debug: boolean;
};
export enum TestDataKinds {
Workspace,
FolderOrFile,
Collection,
Case,
}
export interface TestData {
rawId: string;
runId: string;
id: string;
uri: Uri;
parentId?: string;
kind: TestDataKinds;
}
export const ITestDiscoveryHelper = Symbol('ITestDiscoveryHelper');
export interface ITestDiscoveryHelper {
runTestDiscovery(options: TestDiscoveryOptions): Promise<RawDiscoveredTests[]>;
}
export type TestRefreshOptions = { forceRefresh: boolean };
export const ITestController = Symbol('ITestController');
export interface ITestController {
refreshTestData(resource?: Uri, options?: TestRefreshOptions): Promise<void>;
stopRefreshing(): void;
onRefreshingCompleted: Event<void>;
onRefreshingStarted: Event<void>;
onRunWithoutConfiguration: Event<WorkspaceFolder[]>;
}
export interface ITestRun {
includes: TestItem[];
excludes: TestItem[];
runKind: TestRunProfileKind;
runInstance: TestRun;
}
export const ITestFrameworkController = Symbol('ITestFrameworkController');
export interface ITestFrameworkController {
resolveChildren(testController: TestController, item: TestItem): Promise<void>;
refreshTestData(testController: TestController, resource?: Uri, token?: CancellationToken): Promise<void>;
runTests(testRun: ITestRun, workspace: WorkspaceFolder, token: CancellationToken): Promise<void>;
}
export const ITestsRunner = Symbol('ITestsRunner');
export interface ITestsRunner {
runTests(testRun: ITestRun, options: TestRunOptions, idToRawData: Map<string, TestData>): Promise<void>;
}
export type TestRunOptions = {
workspaceFolder: Uri;
cwd: string;
args: string[];
token: CancellationToken;
};
// We expose these here as a convenience and to cut down on churn
// elsewhere in the code.
type RawTestNode = {
id: string;
name: string;
parentid: string;
};
export type RawTestParent = RawTestNode & {
kind: 'folder' | 'file' | 'suite' | 'function' | 'workspace';
};
type RawTestFSNode = RawTestParent & {
kind: 'folder' | 'file';
relpath: string;
};
export type RawTestFolder = RawTestFSNode & {
kind: 'folder';
};
export type RawTestFile = RawTestFSNode & {
kind: 'file';
};
export type RawTestSuite = RawTestParent & {
kind: 'suite';
};
// function-as-a-container is for parameterized ("sub") tests.
export type RawTestFunction = RawTestParent & {
kind: 'function';
};
export type RawTest = RawTestNode & {
source: string;
};
export type RawDiscoveredTests = {
rootid: string;
root: string;
parents: RawTestParent[];
tests: RawTest[];
};