Skip to content

Commit 3671ccd

Browse files
committed
log collection of test collection
1 parent f84867a commit 3671ccd

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/client/unittests/nosetest/collector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as os from 'os';
66
import { extractBetweenDelimiters, convertFileToPackage, flattenTestFiles } from '../common/testUtils';
77
import { CancellationToken } from 'vscode';
88
import { PythonSettings } from '../../common/configSettings';
9+
import { OutputChannel } from 'vscode';
910

1011
const pythonSettings = PythonSettings.getInstance();
1112
const NOSE_WANT_FILE_PREFIX = 'nose.selector: DEBUG: wantFile ';
@@ -20,7 +21,7 @@ const argsToExcludeForDiscovery = ['-v', '--verbose',
2021
'--failed', '--process-restartworker', '--with-xunit'];
2122
const settingsInArgsToExcludeForDiscovery = ['--verbosity'];
2223

23-
export function discoverTests(rootDirectory: string, args: string[], token: CancellationToken): Promise<Tests> {
24+
export function discoverTests(rootDirectory: string, args: string[], token: CancellationToken, ignoreCache: boolean, outChannel: OutputChannel): Promise<Tests> {
2425
let logOutputLines: string[] = [''];
2526
let testFiles: TestFile[] = [];
2627

@@ -79,6 +80,7 @@ export function discoverTests(rootDirectory: string, args: string[], token: Canc
7980

8081
return execPythonFile(pythonSettings.unitTest.nosetestPath, args.concat(['--collect-only', '-vvv']), rootDirectory, true)
8182
.then(data => {
83+
outChannel.appendLine(data);
8284
processOutput(data);
8385

8486
// Exclude tests that don't have any functions or test suites

src/client/unittests/nosetest/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class TestManager extends BaseTestManager {
1616
}
1717
discoverTestsImpl(ignoreCache: boolean): Promise<Tests> {
1818
let args = settings.unitTest.nosetestArgs.slice(0);
19-
return discoverTests(this.rootDirectory, args, this.cancellationToken);
19+
return discoverTests(this.rootDirectory, args, this.cancellationToken, ignoreCache, this.outputChannel);
2020
}
2121
runTestImpl(tests: Tests, testsToRun?: TestsToRun, runFailedTests?: boolean, debug?: boolean): Promise<any> {
2222
let args = settings.unitTest.nosetestArgs.slice(0);

src/client/unittests/pytest/collector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { extractBetweenDelimiters, flattenTestFiles, convertFileToPackage } from
66
import * as vscode from 'vscode';
77
import * as path from 'path';
88
import { PythonSettings } from '../../common/configSettings';
9+
import { OutputChannel } from 'vscode';
910

1011
const pythonSettings = PythonSettings.getInstance();
1112

@@ -17,7 +18,7 @@ const argsToExcludeForDiscovery = ['-x', '--exitfirst',
1718
'--disable-pytest-warnings', '-l', '--showlocals'];
1819
const settingsInArgsToExcludeForDiscovery = [];
1920

20-
export function discoverTests(rootDirectory: string, args: string[], token: vscode.CancellationToken, ignoreCache: boolean): Promise<Tests> {
21+
export function discoverTests(rootDirectory: string, args: string[], token: vscode.CancellationToken, ignoreCache: boolean, outChannel: OutputChannel): Promise<Tests> {
2122
let logOutputLines: string[] = [''];
2223
let testFiles: TestFile[] = [];
2324
let parentNodes: { indent: number, item: TestFile | TestSuite }[] = [];
@@ -86,6 +87,7 @@ export function discoverTests(rootDirectory: string, args: string[], token: vsco
8687

8788
return execPythonFile(pythonSettings.unitTest.pyTestPath, args.concat(['--collect-only']), rootDirectory, false, null, token)
8889
.then(data => {
90+
outChannel.appendLine(data);
8991
processOutput(data);
9092
if (token && token.isCancellationRequested) {
9193
return Promise.reject<Tests>('cancelled');

src/client/unittests/pytest/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class TestManager extends BaseTestManager {
1414
}
1515
discoverTestsImpl(ignoreCache: boolean): Promise<Tests> {
1616
let args = settings.unitTest.pyTestArgs.slice(0);
17-
return discoverTests(this.rootDirectory, args, this.cancellationToken, ignoreCache);
17+
return discoverTests(this.rootDirectory, args, this.cancellationToken, ignoreCache, this.outputChannel);
1818
}
1919
runTestImpl(tests: Tests, testsToRun?: TestsToRun, runFailedTests?: boolean, debug?: boolean): Promise<any> {
2020
let args = settings.unitTest.pyTestArgs.slice(0);

src/client/unittests/unittest/collector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { flattenTestFiles } from '../common/testUtils';
55
import * as vscode from 'vscode';
66
import * as path from 'path';
77
import { PythonSettings } from '../../common/configSettings';
8+
import { OutputChannel } from 'vscode';
89

910
const pythonSettings = PythonSettings.getInstance();
1011

11-
export function discoverTests(rootDirectory: string, args: string[], token: vscode.CancellationToken): Promise<Tests> {
12+
export function discoverTests(rootDirectory: string, args: string[], token: vscode.CancellationToken, ignoreCache: boolean, outChannel: OutputChannel): Promise<Tests> {
1213
let startDirectory = '.';
1314
let pattern = 'test*.py';
1415
const indexOfStartDir = args.findIndex(arg => arg.indexOf('-s') === 0);
@@ -74,6 +75,7 @@ for suite in suites._tests:
7475
args = [];
7576
return execPythonFile(pythonSettings.pythonPath, args.concat(['-c', pythonScript]), rootDirectory, true, null, token)
7677
.then(data => {
78+
outChannel.appendLine(data);
7779
processOutput(data);
7880
if (token && token.isCancellationRequested) {
7981
return Promise.reject<Tests>('cancelled');

src/client/unittests/unittest/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class TestManager extends BaseTestManager {
1616
}
1717
discoverTestsImpl(ignoreCache: boolean): Promise<Tests> {
1818
let args = settings.unitTest.unittestArgs.slice(0);
19-
return discoverTests(this.rootDirectory, args, this.cancellationToken);
19+
return discoverTests(this.rootDirectory, args, this.cancellationToken, ignoreCache, this.outputChannel);
2020
}
2121
runTestImpl(tests: Tests, testsToRun?: TestsToRun, runFailedTests?: boolean, debug?: boolean): Promise<any> {
2222
let args = settings.unitTest.unittestArgs.slice(0);

0 commit comments

Comments
 (0)