Closed keegancsmith closed 6 years ago
I was a bit suprised that this is so coupled to LSP. My initial thought was that a record&replay tool doesn't require any knowledge about LSP and can work for any JSONRPC server. My second thought was that an LSP record&replay tool doesn't require any knowledge about Sourcegraph and Sourcegraph LSP extensions and can work for any LS. Some more documentation what this does on a high level would be helpful. The code could use some comments too.
I will update, but this tool is opinionated and is intended for basic integration tests of the dockerfiles we create, rather than a general swiss army knife (for now).
I was a bit suprised that this is so coupled to LSP. My initial thought was that a record&replay tool doesn't require any knowledge about LSP and can work for any JSONRPC server. My second thought was that an LSP record&replay tool doesn't require any knowledge about Sourcegraph and Sourcegraph LSP extensions and can work for any LS.
It is working at the JSONRPC2 layer. However, we do two specific things that are not just about the transport layer:
For 1. we do this to make the recorded sessions easy for a human to read, rather than full of noise containing file contents. For 2, this is because the tool is intended for testing the dockerfiles we create, and only that. It could evolve further than that, but for now it lives in an internal package.
Some more documentation what this does on a high level would be helpful. The code could use some comments too.
Yes I will add more. This is in a working state and I wanted to get feedback before signing out for the day (given I am in a different TZ).
Merging in to make follow-up PRs smaller rather than letting this one grow.
This is an initial version of
lsp-record
. It both records and replays LSP sessions, supports our remotegit://
style root URIs, and automated parts of docker build/run. This allows us to record a session using Sourcegraph, and then later play it back to confirm if the output still matches. Still to come is the infrastructure around confirming if the recorded outputs still match is missing, but the bulk of the work is done.Here is how the docker testdata was created: