diff --git a/src/vs/workbench/api/browser/mainThreadTesting.ts b/src/vs/workbench/api/browser/mainThreadTesting.ts index 334ea1ce08a..9e54f5e9e2e 100644 --- a/src/vs/workbench/api/browser/mainThreadTesting.ts +++ b/src/vs/workbench/api/browser/mainThreadTesting.ts @@ -6,19 +6,19 @@ import { VSBuffer } from 'vs/base/common/buffer'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { revive } from 'vs/base/common/marshalling'; import { isDefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; import { MutableObservableValue } from 'vs/workbench/contrib/testing/common/observableValue'; import { ExtensionRunTestsRequest, IFileCoverage, ITestItem, ITestMessage, ITestRunProfile, ITestRunTask, ResolvedTestRunRequest, SerializedTestMessage, TestDiffOpType, TestResultState, TestsDiff } from 'vs/workbench/contrib/testing/common/testCollection'; -import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testProfileService'; import { TestCoverage } from 'vs/workbench/contrib/testing/common/testCoverage'; +import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testProfileService'; import { LiveTestResult } from 'vs/workbench/contrib/testing/common/testResult'; import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; import { IMainThreadTestController, ITestRootProvider, ITestService } from 'vs/workbench/contrib/testing/common/testService'; import { ExtHostContext, ExtHostTestingShape, IExtHostContext, ILocationDto, ITestControllerPatch, MainContext, MainThreadTestingShape } from '../common/extHost.protocol'; -import { revive } from 'vs/base/common/marshalling'; const reviveDiff = (diff: TestsDiff) => { for (const entry of diff) { diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index 2805e98f7ff..37991014b7b 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -151,6 +151,7 @@ export class ExtHostTesting implements ExtHostTestingShape { } await this.proxy.$runTests({ + isUiTriggered: false, targets: [{ testIds: req.include?.map(t => t.id) ?? [controller.collection.root.id], profileGroup: profileGroupToBitset[profile.kind], diff --git a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts index 45dbb7b7c43..1fe63cd35c4 100644 --- a/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts +++ b/src/vs/workbench/contrib/testing/browser/testingExplorerView.ts @@ -53,6 +53,7 @@ import { ByNameTestItemElement, HierarchicalByNameProjection } from 'vs/workbenc import { ITestTreeProjection, TestExplorerTreeElement, TestItemTreeElement, TestTreeErrorMessage } from 'vs/workbench/contrib/testing/browser/explorerProjections/index'; import { getTestItemContextOverlay } from 'vs/workbench/contrib/testing/browser/explorerProjections/testItemContextOverlay'; import * as icons from 'vs/workbench/contrib/testing/browser/icons'; +import { ConfigureTestProfilesAction, DebugSelectedAction, RunSelectedAction, SelectDefaultTestProfiles } from 'vs/workbench/contrib/testing/browser/testExplorerActions'; import { TestingExplorerFilter } from 'vs/workbench/contrib/testing/browser/testingExplorerFilter'; import { ITestingProgressUiService } from 'vs/workbench/contrib/testing/browser/testingProgressUiService'; import { getTestingConfiguration, TestingConfigKeys } from 'vs/workbench/contrib/testing/common/configuration'; @@ -69,7 +70,6 @@ import { TestResultItemChangeReason } from 'vs/workbench/contrib/testing/common/ import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService'; import { IMainThreadTestCollection, ITestService, testCollectionIsEmpty } from 'vs/workbench/contrib/testing/common/testService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ConfigureTestProfilesAction, DebugSelectedAction, RunSelectedAction, SelectDefaultTestProfiles } from './testExplorerActions'; export class TestingExplorerView extends ViewPane { public viewModel!: TestingExplorerViewModel; diff --git a/src/vs/workbench/contrib/testing/browser/testingProgressUiService.ts b/src/vs/workbench/contrib/testing/browser/testingProgressUiService.ts index dae9d3e35b3..778653c9056 100644 --- a/src/vs/workbench/contrib/testing/browser/testingProgressUiService.ts +++ b/src/vs/workbench/contrib/testing/browser/testingProgressUiService.ts @@ -58,6 +58,10 @@ export class TestingProgressTrigger extends Disposable { } private attachAutoOpenForNewResults(result: LiveTestResult) { + if (result.request.isUiTriggered === false) { + return; + } + const cfg = getTestingConfiguration(this.configurationService, TestingConfigKeys.OpenTesting); if (cfg === AutoOpenTesting.NeverOpen) { return; diff --git a/src/vs/workbench/contrib/testing/common/testCollection.ts b/src/vs/workbench/contrib/testing/common/testCollection.ts index 9646aefa17a..2d32a1f2896 100644 --- a/src/vs/workbench/contrib/testing/common/testCollection.ts +++ b/src/vs/workbench/contrib/testing/common/testCollection.ts @@ -61,9 +61,11 @@ export interface ResolvedTestRunRequest { controllerId: string; profileGroup: TestRunProfileBitset; profileId: number; - }[] + }[]; exclude?: string[]; isAutoRun?: boolean; + /** Whether this was trigged by a user action in UI. Default=true */ + isUiTriggered?: boolean; } /** diff --git a/src/vs/workbench/contrib/testing/common/testResultService.ts b/src/vs/workbench/contrib/testing/common/testResultService.ts index cd834ed1c91..061f3694be8 100644 --- a/src/vs/workbench/contrib/testing/common/testResultService.ts +++ b/src/vs/workbench/contrib/testing/common/testResultService.ts @@ -152,6 +152,7 @@ export class TestResultService implements ITestResultService { } const resolved: ResolvedTestRunRequest = { + isUiTriggered: false, targets: [], exclude: req.exclude, isAutoRun: false,