Skip to content

Commit

Permalink
testing: finalize selected profiles (#202878)
Browse files Browse the repository at this point in the history
Closes #193160
  • Loading branch information
connor4312 authored Jan 19, 2024
1 parent 6c8cbf4 commit 0865a60
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 23 deletions.
6 changes: 1 addition & 5 deletions src/vs/workbench/api/common/extHostTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class ExtHostTesting extends Disposable implements ExtHostTestingShape {
profileId++;
}

return new TestRunProfileImpl(this.proxy, profiles, extension, activeProfiles, this.defaultProfilesChangedEmitter.event, controllerId, profileId, label, group, runHandler, isDefault, tag, supportsContinuousRun);
return new TestRunProfileImpl(this.proxy, profiles, activeProfiles, this.defaultProfilesChangedEmitter.event, controllerId, profileId, label, group, runHandler, isDefault, tag, supportsContinuousRun);
},
createTestItem(id, label, uri) {
return new TestItemImpl(controllerId, id, label, uri);
Expand Down Expand Up @@ -1068,7 +1068,6 @@ const updateProfile = (impl: TestRunProfileImpl, proxy: MainThreadTestingShape,

export class TestRunProfileImpl implements vscode.TestRunProfile {
readonly #proxy: MainThreadTestingShape;
readonly #extension: IRelaxedExtensionDescription;
readonly #activeProfiles: Set<number>;
readonly #onDidChangeDefaultProfiles: Event<DefaultProfileChangeEvent>;
#initialPublish?: ITestRunProfile;
Expand Down Expand Up @@ -1140,7 +1139,6 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
}

public get onDidChangeDefault() {
checkProposedApiEnabled(this.#extension, 'testingActiveProfile');
return Event.chain(this.#onDidChangeDefaultProfiles, $ => $
.map(ev => ev.get(this.controllerId)?.get(this.profileId))
.filter(isDefined)
Expand All @@ -1150,7 +1148,6 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
constructor(
proxy: MainThreadTestingShape,
profiles: Map<number, vscode.TestRunProfile>,
extension: IRelaxedExtensionDescription,
activeProfiles: Set<number>,
onDidChangeActiveProfiles: Event<DefaultProfileChangeEvent>,
public readonly controllerId: string,
Expand All @@ -1164,7 +1161,6 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
) {
this.#proxy = proxy;
this.#profiles = profiles;
this.#extension = extension;
this.#activeProfiles = activeProfiles;
this.#onDidChangeDefaultProfiles = onDidChangeActiveProfiles;
profiles.set(profileId, this);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/test/browser/extHostTesting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ suite('ExtHost Testing', () => {
cts = new CancellationTokenSource();
c = new TestRunCoordinator(proxy, new NullLogService());

configuration = new TestRunProfileImpl(mockObject<MainThreadTestingShape>()(), new Map(), nullExtensionDescription, new Set(), Event.None, 'ctrlId', 42, 'Do Run', TestRunProfileKind.Run, () => { }, false);
configuration = new TestRunProfileImpl(mockObject<MainThreadTestingShape>()(), new Map(), new Set(), Event.None, 'ctrlId', 42, 'Do Run', TestRunProfileKind.Run, () => { }, false);

await single.expand(single.root.id, Infinity);
single.collectDiff();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export const allApiProposals = Object.freeze({
terminalSelection: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts',
testCoverage: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testCoverage.d.ts',
testObserver: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts',
testingActiveProfile: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testingActiveProfile.d.ts',
textSearchProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts',
timeline: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts',
tokenInformation: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts',
Expand Down
6 changes: 6 additions & 0 deletions src/vscode-dts/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17149,6 +17149,12 @@ declare module 'vscode' {
*/
isDefault: boolean;

/**
* Fired when a user has changed whether this is a default profile. The
* event contains the new value of {@link isDefault}
*/
onDidChangeDefault: Event<boolean>;

/**
* Whether this profile supports continuous running of requests. If so,
* then {@link TestRunRequest.continuous} may be set to `true`. Defaults
Expand Down
16 changes: 0 additions & 16 deletions src/vscode-dts/vscode.proposed.testingActiveProfile.d.ts

This file was deleted.

0 comments on commit 0865a60

Please sign in to comment.