forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
152 lines (130 loc) · 3.9 KB
/
types.ts
File metadata and controls
152 lines (130 loc) · 3.9 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import { CancellationToken, Disposable, OutputChannel, Uri } from 'vscode';
import { Product } from '../../common/installer';
import { BaseTestManager } from './baseTestManager';
export type TestFolder = TestResult & {
name: string;
testFiles: TestFile[];
nameToRun: string;
status?: TestStatus;
folders: TestFolder[];
};
export type TestFile = TestResult & {
name: string;
fullPath: string;
functions: TestFunction[];
suites: TestSuite[];
nameToRun: string;
xmlName: string;
status?: TestStatus;
errorsWhenDiscovering?: string;
};
export type TestSuite = TestResult & {
name: string;
functions: TestFunction[];
suites: TestSuite[];
isUnitTest: Boolean;
isInstance: Boolean;
nameToRun: string;
xmlName: string;
status?: TestStatus;
};
export type TestFunction = TestResult & {
name: string;
nameToRun: string;
status?: TestStatus;
};
export type TestResult = Node & {
passed?: boolean;
time: number;
line?: number;
message?: string;
traceback?: string;
functionsPassed?: number;
functionsFailed?: number;
functionsDidNotRun?: number;
};
export type Node = {
expanded?: Boolean;
};
export type FlattenedTestFunction = {
testFunction: TestFunction;
parentTestSuite?: TestSuite;
parentTestFile: TestFile;
xmlClassName: string;
};
export type FlattenedTestSuite = {
testSuite: TestSuite;
parentTestSuite?: TestSuite;
parentTestFile: TestFile;
xmlClassName: string;
};
export type TestSummary = {
passed: number;
failures: number;
errors: number;
skipped: number;
};
export type Tests = {
summary: TestSummary;
testFiles: TestFile[];
testFunctions: FlattenedTestFunction[];
testSuites: FlattenedTestSuite[];
testFolders: TestFolder[];
rootTestFolders: TestFolder[];
};
export enum TestStatus {
Unknown,
Discovering,
Idle,
Running,
Fail,
Error,
Skipped,
Pass
}
export type TestsToRun = {
testFolder?: TestFolder[];
testFile?: TestFile[];
testSuite?: TestSuite[];
testFunction?: TestFunction[];
};
export type UnitTestProduct = Product.nosetest | Product.pytest | Product.unittest;
export interface ITestConfigSettingsService {
updateTestArgs(testDirectory: string, product: UnitTestProduct, args: string[]): Promise<void>;
enable(testDirectory: string | Uri, product: UnitTestProduct): Promise<void>;
disable(testDirectory: string | Uri, product: UnitTestProduct): Promise<void>;
}
export interface ITestManagerService extends Disposable {
getTestManager(): BaseTestManager | undefined;
getTestWorkingDirectory(): string;
getPreferredTestManager(): UnitTestProduct | undefined;
}
export interface ITestManagerServiceFactory {
createTestManagerService(wkspace: Uri): ITestManagerService;
}
export interface IWorkspaceTestManagerService extends Disposable {
getTestManager(resource: Uri): BaseTestManager | undefined;
getTestWorkingDirectory(resource: Uri): string;
getPreferredTestManager(resource: Uri): UnitTestProduct | undefined;
}
export interface ITestsHelper {
flattenTestFiles(testFiles: TestFile[]): Tests;
placeTestFilesIntoFolders(tests: Tests): void;
}
export interface ITestVisitor {
visitTestFunction(testFunction: TestFunction): void;
visitTestSuite(testSuite: TestSuite): void;
visitTestFile(testFile: TestFile): void;
visitTestFolder(testFile: TestFolder): void;
}
export interface ITestCollectionStorageService extends Disposable {
getTests(wkspace: Uri): Tests | undefined;
storeTests(wkspace: Uri, tests: Tests | null | undefined): void;
}
export interface ITestResultsService {
resetResults(tests: Tests): void;
updateResults(tests: Tests): void;
}
export interface ITestDebugLauncher {
launchDebugger(rootDirectory: string, testArgs: string[], token?: CancellationToken, outChannel?: OutputChannel): Promise<Tests>;
}