forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
106 lines (90 loc) · 3.62 KB
/
types.ts
File metadata and controls
106 lines (90 loc) · 3.62 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
import { CancellationToken, Disposable, OutputChannel, Uri } from 'vscode';
import { Product } from '../../common/types';
import { TestSettingsPropertyNames } from '../configuration/types';
import { TestProvider } from '../types';
export type UnitTestProduct = Product.pytest | Product.unittest;
// ****************
// test args/options
export type TestDiscoveryOptions = {
workspaceFolder: Uri;
cwd: string;
args: string[];
token?: CancellationToken;
ignoreCache: boolean;
outChannel?: OutputChannel;
};
export type UnitTestParserOptions = TestDiscoveryOptions & { startDirectory: string };
export type LaunchOptions = {
cwd: string;
args: string[];
testProvider: TestProvider;
token?: CancellationToken;
outChannel?: OutputChannel;
pytestPort?: string;
pytestUUID?: string;
runTestIdsPort?: string;
};
export type ParserOptions = TestDiscoveryOptions;
export type Options = {
workspaceFolder: Uri;
cwd: string;
args: string[];
outChannel?: OutputChannel;
token?: CancellationToken;
};
export enum TestFilter {
removeTests = 'removeTests',
discovery = 'discovery',
runAll = 'runAll',
runSpecific = 'runSpecific',
debugAll = 'debugAll',
debugSpecific = 'debugSpecific',
}
// ****************
// interfaces
export const ITestsHelper = Symbol('ITestsHelper');
export interface ITestsHelper {
parseProviderName(product: UnitTestProduct): TestProvider;
parseProduct(provider: TestProvider): UnitTestProduct;
getSettingsPropertyNames(product: Product): TestSettingsPropertyNames;
}
export const ITestConfigurationService = Symbol('ITestConfigurationService');
export interface ITestConfigurationService {
displayTestFrameworkError(wkspace: Uri): Promise<void>;
selectTestRunner(placeHolderMessage: string): Promise<UnitTestProduct | undefined>;
enableTest(wkspace: Uri, product: UnitTestProduct): Promise<void>;
promptToEnableAndConfigureTestFramework(wkspace: Uri): Promise<void>;
}
export const ITestConfigSettingsService = Symbol('ITestConfigSettingsService');
export interface ITestConfigSettingsService {
updateTestArgs(testDirectory: string | Uri, product: UnitTestProduct, args: string[]): Promise<void>;
enable(testDirectory: string | Uri, product: UnitTestProduct): Promise<void>;
disable(testDirectory: string | Uri, product: UnitTestProduct): Promise<void>;
getTestEnablingSetting(product: UnitTestProduct): string;
}
export interface ITestConfigurationManager {
requiresUserToConfigure(wkspace: Uri): Promise<boolean>;
configure(wkspace: Uri): Promise<void>;
enable(): Promise<void>;
disable(): Promise<void>;
}
export const ITestConfigurationManagerFactory = Symbol('ITestConfigurationManagerFactory');
export interface ITestConfigurationManagerFactory {
create(wkspace: Uri, product: Product, cfg?: ITestConfigSettingsService): ITestConfigurationManager;
}
export const ITestDebugLauncher = Symbol('ITestDebugLauncher');
export interface ITestDebugLauncher {
launchDebugger(options: LaunchOptions, callback?: () => void): Promise<void>;
}
export const IUnitTestSocketServer = Symbol('IUnitTestSocketServer');
export interface IUnitTestSocketServer extends Disposable {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
on(event: string | symbol, listener: (...args: any[]) => void): this;
removeAllListeners(event?: string | symbol): this;
start(options?: { port?: number; host?: string }): Promise<number>;
stop(): void;
}
export const ITestRunner = Symbol('ITestRunner');
export interface ITestRunner {
run(testProvider: TestProvider, options: Options): Promise<string>;
}