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
81 lines (70 loc) · 2.86 KB
/
Copy pathtypes.ts
File metadata and controls
81 lines (70 loc) · 2.86 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
import { CancellationToken, DebugSessionOptions, 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 LaunchOptions = {
cwd: string;
args: string[];
testProvider: TestProvider;
token?: CancellationToken;
outChannel?: OutputChannel;
pytestPort?: string;
pytestUUID?: string;
runTestIdsPort?: string;
};
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 {
hasConfiguredTests(wkspace: Uri): boolean;
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, sessionOptions?: DebugSessionOptions): Promise<void>;
}