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.
matklad wasn't really keen on it previously because they're pretty finicky to write and the cost/benefit seems high
I've tried https://github.com/microsoft/vscode-test and it does not look too burden. Not to say easy :)
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
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?
Yup, :thumbs_up: on client-side tests
We actually had them for
cargo check, while that was implemented client-side
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)