未验证 提交 bb480d2c 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #111916 from microsoft/alex/104004

Only run tests if the tests belong to a known extension
......@@ -35,6 +35,8 @@ import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelServ
import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService';
import { Emitter, Event } from 'vs/base/common/event';
import { IExtensionActivationHost, checkActivateWorkspaceContainsExtension } from 'vs/workbench/api/common/shared/workspaceContains';
import { isEqualOrParent } from 'vs/base/common/extpath';
import { isLinux } from 'vs/base/common/platform';
interface ITestRunner {
/** Old test runner API, as exported from `vscode/lib/testrunner` */
......@@ -537,6 +539,20 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
const extensionTestsPath = originalFSPath(extensionTestsLocationURI);
let knowsExtension = false;
for (const extension of this._registry.getAllExtensionDescriptions()) {
if (extension.extensionLocation.scheme === Schemas.file) {
const extensionPath = originalFSPath(extension.extensionLocation);
if (isEqualOrParent(extensionTestsPath, extensionPath, !isLinux)) {
knowsExtension = true;
}
}
}
if (!knowsExtension) {
return Promise.resolve(undefined);
}
// Require the test runner via node require from the provided path
let testRunner: ITestRunner | INewTestRunner | undefined;
let requireError: Error | undefined;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册