Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: finalize selected profiles #202878

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -100,7 +100,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.

Loading