Stream: t-compiler/wg-rls-2.0

Topic: vscode integration tests


vsrs (May 20 2020 at 07:32, on Zulip):

Hi.

Maybe we should add some vscode integration tests to the CI? For example, I merely forgot to test binary targets and voila.. https://github.com/rust-analyzer/rust-analyzer/pull/4528

With minimal smoke testing, it would not happen. Are there any reasons not to add the extension testing into the CI?

P.S. The situation will get even more worse if we support different API for different vscode versions. mocha and vscode-test can help a lot.

Laurențiu Nicola (May 20 2020 at 07:34, on Zulip):

matklad wasn't really keen on it previously because they're pretty finicky to write and the cost/benefit seems high

vsrs (May 20 2020 at 07:41, on Zulip):

I've tried https://github.com/microsoft/vscode-test and it does not look too burden. Not to say easy :)

matklad (May 20 2020 at 08:05, on Zulip):

I would be -1 on VS Code tests that spawn an actual rust-analyzer/cargo process. Adding unit tests seems fine to me, but I would strongly prefer to "just" write code that doesn't need a lot of testing.

Ie, ideally, I'd love to see a well-typed interface on the server, and a well-typed interface on the client, such that:

But yeah, the above case is exactly where we have some meaningful logic on the client

vsrs (May 20 2020 at 08:47, on Zulip):

I did not mean heavy tests with actual workspace building\running. Only some client-specific logic tests. I've called them integration because they might involve vscode running.

Though I would prefer to remove any logic from the client-side at all it is not always possible. For the above-mentioned case it is possible, I hope. Just not at the moment.

So, can I add such 'client unit-tests' to the master or it would be better to keep them in my local branches?

matklad (May 20 2020 at 08:50, on Zulip):

Yup, :thumbs_up: on client-side tests

matklad (May 20 2020 at 08:50, on Zulip):

We actually had them for cargo check, while that was implemented client-side

vsrs (May 20 2020 at 08:56, on Zulip):

Great! For the start I'll add them for a launch configuration generation and a bit later for shared downloads (https://github.com/rust-analyzer/rust-analyzer/issues/4469)

Last update: Oct 28 2020 at 18:00UTC