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

Clarification on the extensionTestsPath run signature #213

Closed
JustinGrote opened this issue Apr 13, 2023 · 3 comments · Fixed by #214
Closed

Clarification on the extensionTestsPath run signature #213

JustinGrote opened this issue Apr 13, 2023 · 3 comments · Fixed by #214

Comments

@JustinGrote
Copy link

JustinGrote commented Apr 13, 2023

The help specifies this:

	 * Must export a `run` function of the following signature:
	 *
	 * ```ts
	 * function run(): Promise<void>;
	 * ```

But the samples entrypoints have parameters:

export function run(testsRoot: string, cb: (error: any, failures?: number) => void): void {

When I try this myself, the first param gets populated with the name of the test file that was called (not the "root" as the line proposes), and the callback seems to be null. Is the help out of date or am I missing something?

CC @connor4312

@connor4312
Copy link
Member

connor4312 commented Apr 14, 2023

The second argument should definitely be there. This is where it gets called:

https://github.com/microsoft/vscode/blob/b45aed4afc4f716b18a849c420e67211eaea8b87/src/vs/workbench/api/common/extHostExtensionService.ts#L736

I see that when run() gets called as well. I will update docs. Though it seems like passing the path is kind of useless 🤷

@JustinGrote
Copy link
Author

@connor4312 confirmed that the cb does exist, for some reason it wasn't evaluating right. Thanks! And yeah the testsRoot is pretty useless since you can just get it from execpath.

I also see it is noted there as the "old" API, looks like this is just there for compatibility, so either method is supported, thanks for finding the hook.

@connor4312
Copy link
Member

Yea, we have the callback from the pre-promises era. People should not really be using that for new code, so I don't want to document people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants