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

Add tests for the server #592

Open
JohnnyMorganz opened this issue Apr 9, 2024 · 1 comment
Open

Add tests for the server #592

JohnnyMorganz opened this issue Apr 9, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JohnnyMorganz
Copy link
Owner

JohnnyMorganz commented Apr 9, 2024

One thing this project is severely lacking is test cases. This primarily stems from the fact that the structure to build test cases is not simple, creating a barrier to entry to writing these cases.

We should invest some time into improving the test fixtures for testing, so that it is easier to write tests. And then, write some common test cases we are missing (Maybe go back and find bugs to add regression tests for?).

It would be nice to research what other language servers are doing to support testing.

Some particular areas we really should be testing:

  • File resolution (we need a way to create a directory structure for testing)
  • Which leads to, cross-file tests. This is pretty important, as many LSP actions are due to cross-file references!
  • The whole language server lifecycle (Nothing in LanguageServer.cpp is tested, we only use the workspace functions as entry points)

We could also write a few E2E integration tests with JSON input and output. Probably better to minimise these if possible.

@JohnnyMorganz JohnnyMorganz added enhancement New feature or request help wanted Extra attention is needed labels Apr 9, 2024
@JohnnyMorganz
Copy link
Owner Author

JohnnyMorganz commented Jun 5, 2024

Bugs that would be useful to test for: #641, #634

The main thing that is missing is scaffolding to perform tests that rely on multiple files, required files, or sourcemaps. Once we get something sorted for that, we are golden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant