|
1 | | -// Copyright (c) Microsoft Corporation. All rights reserved. |
2 | | -// Licensed under the MIT License. |
| 1 | +// // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// // Licensed under the MIT License. |
3 | 3 |
|
4 | | -import { inject, injectable } from 'inversify'; |
5 | | -import { |
6 | | - ExecutionFactoryCreateWithEnvironmentOptions, |
7 | | - IPythonExecutionFactory, |
8 | | - SpawnOptions, |
9 | | -} from '../../../common/process/types'; |
10 | | -import { TestDiscoveryOptions } from '../../common/types'; |
11 | | -import { ITestDiscoveryHelper, RawDiscoveredTests } from './types'; |
| 4 | +// import { inject, injectable } from 'inversify'; |
| 5 | +// import { |
| 6 | +// ExecutionFactoryCreateWithEnvironmentOptions, |
| 7 | +// IPythonExecutionFactory, |
| 8 | +// SpawnOptions, |
| 9 | +// } from '../../../common/process/types'; |
| 10 | +// import { TestDiscoveryOptions } from '../../common/types'; |
| 11 | +// import { ITestDiscoveryHelper, RawDiscoveredTests } from './types'; |
12 | 12 |
|
13 | | -@injectable() |
14 | | -export class TestDiscoveryHelper implements ITestDiscoveryHelper { |
15 | | - constructor(@inject(IPythonExecutionFactory) private readonly pythonExecFactory: IPythonExecutionFactory) {} |
| 13 | +// @injectable() |
| 14 | +// export class TestDiscoveryHelper implements ITestDiscoveryHelper { |
| 15 | +// constructor(@inject(IPythonExecutionFactory) private readonly pythonExecFactory: IPythonExecutionFactory) {} |
16 | 16 |
|
17 | | - public async runTestDiscovery(options: TestDiscoveryOptions): Promise<RawDiscoveredTests[]> { |
18 | | - const creationOptions: ExecutionFactoryCreateWithEnvironmentOptions = { |
19 | | - allowEnvironmentFetchExceptions: false, |
20 | | - resource: options.workspaceFolder, |
21 | | - }; |
22 | | - const execService = await this.pythonExecFactory.createActivatedEnvironment(creationOptions); |
| 17 | +// public async runTestDiscovery(options: TestDiscoveryOptions): Promise<RawDiscoveredTests[]> { |
| 18 | +// const creationOptions: ExecutionFactoryCreateWithEnvironmentOptions = { |
| 19 | +// allowEnvironmentFetchExceptions: false, |
| 20 | +// resource: options.workspaceFolder, |
| 21 | +// }; |
| 22 | +// const execService = await this.pythonExecFactory.createActivatedEnvironment(creationOptions); |
23 | 23 |
|
24 | | - const spawnOptions: SpawnOptions = { |
25 | | - token: options.token, |
26 | | - cwd: options.cwd, |
27 | | - throwOnStdErr: true, |
28 | | - }; |
| 24 | +// const spawnOptions: SpawnOptions = { |
| 25 | +// token: options.token, |
| 26 | +// cwd: options.cwd, |
| 27 | +// throwOnStdErr: true, |
| 28 | +// }; |
29 | 29 |
|
30 | | - if (options.outChannel) { |
31 | | - options.outChannel.appendLine(`python ${options.args.join(' ')}`); |
32 | | - } |
| 30 | +// if (options.outChannel) { |
| 31 | +// options.outChannel.appendLine(`python ${options.args.join(' ')}`); |
| 32 | +// } |
33 | 33 |
|
34 | | - const proc = await execService.exec(options.args, spawnOptions); |
35 | | - try { |
36 | | - return JSON.parse(proc.stdout); |
37 | | - } catch (ex) { |
38 | | - const error = ex as SyntaxError; |
39 | | - error.message = proc.stdout; |
40 | | - throw ex; // re-throw |
41 | | - } |
42 | | - } |
43 | | -} |
| 34 | +// const proc = await execService.exec(options.args, spawnOptions); |
| 35 | +// try { |
| 36 | +// return JSON.parse(proc.stdout); |
| 37 | +// } catch (ex) { |
| 38 | +// const error = ex as SyntaxError; |
| 39 | +// error.message = proc.stdout; |
| 40 | +// throw ex; // re-throw |
| 41 | +// } |
| 42 | +// } |
| 43 | +// } |
0 commit comments