[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot
From: |
Stefan Kangas |
Subject: |
Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot |
Date: |
Mon, 12 Dec 2022 03:26:22 -0800 |
João Távora <joaotavora@gmail.com> writes:
> I'm going to assume this was on your machine from now on.
This is on my machine (Debian GNU/Linux).
> Can you explain why you have a "rust-analyzer" executable, but not
> "cargo"? Is this a usual Rust setup?
I don't do Rust myself, but when working on Eglot, I installed various
bits and pieces ("rust-analyzer" was among them; "cargo" was not).
> In other tests, such as 'javascript-basic',
> 'project-wide-diagnostics-typescript', the error is strange:
>
> (error "[eglot] -32603: Request initialize failed with message:
> Could not find a valid tsserver version. Exiting.")
This link suggested that "npm install -g typescript" might fix this
error:
https://github.com/typescript-language-server/typescript-language-server/issues/336
So I did that, and now I have a "tsserver" executable as well, and the
test itself seems to be working. I therefore suggest a fix predicating
this test on the existence of that executable.
modified test/lisp/progmodes/eglot-tests.el
@@ -722,7 +722,8 @@ rust-on-type-formatting
(ert-deftest javascript-basic ()
"Test basic autocompletion in a JavaScript LSP."
- (skip-unless (executable-find "typescript-language-server"))
+ (skip-unless (and (executable-find "typescript-language-server")
+ (executable-find "tsserver")))
(eglot--with-fixture
'(("project" . (("hello.js" . "console.log('Hello world!');"))))
(with-current-buffer
@@ -751,7 +752,8 @@ javascript-basic
(ert-deftest project-wide-diagnostics-typescript ()
"Test diagnostics through multiple files in a TypeScript LSP."
- (skip-unless (executable-find "typescript-language-server"))
+ (skip-unless (and (executable-find "typescript-language-server")
+ (executable-find "tsserver")))
(eglot--with-fixture
'(("project" . (("hello.ts" . "const thing = 5;\nexport { thin }")
("hello2.ts" . "import { thing } from './hello'"))))
> In general, I don't know if it's a good idea to keep these tests in
> the normal 'make check' run, since many Eglot tests are dependent on
> having correctly working servers. Or at least what I and other test
> authors believe to be "correctly configured". Which is generally the
> simplest installation method for said servers, with the fewest bells
> and whistles.
Yup; the simplest installation method is what I did in each case.
BTW, I think some of the tests should perhaps be marked :expensive, too.
> Let me know if you've investigated your setup for these servers
> (again, I'm assuming this is on your machine and not EMBA).
As for the autopep8 test, I'm just using the system packages for
autopep8 and pylsp on Debian GNU/Linux bookworm/testing:
$ autopep8 --version
autopep8 2.0.0 (pycodestyle: 2.9.1)
$ pylsp --version
pylsp v1.5.0
Please let me know if you need anything else.
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, Stefan Kangas, 2022/12/12
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, João Távora, 2022/12/12
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot,
Stefan Kangas <=
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, João Távora, 2022/12/12
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, Stefan Kangas, 2022/12/12
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, Michael Albinus, 2022/12/13
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, Stefan Kangas, 2022/12/13
- Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot, Michael Albinus, 2022/12/14