From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot Date: Mon, 12 Dec 2022 03:26:22 -0800 Message-ID: References: <167080394233.4339.5863353994038854528@vcs2.savannah.gnu.org> <20221212001223.E9A9DC004BE@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12566"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 12 12:27:06 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4gxd-0003AF-M4 for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Dec 2022 12:27:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4gx5-0007JS-L7; Mon, 12 Dec 2022 06:26:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4gx0-0007J0-UB for emacs-devel@gnu.org; Mon, 12 Dec 2022 06:26:27 -0500 Original-Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4gwy-0002d2-Pk for emacs-devel@gnu.org; Mon, 12 Dec 2022 06:26:26 -0500 Original-Received: by mail-oi1-x22f.google.com with SMTP id n205so10920727oib.1 for ; Mon, 12 Dec 2022 03:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=waIisInWVBBj6+l8uQy4Y8DNZUFi659SZcWDjk/MqDY=; b=omCNF3jfwyTo8u+tKQEnTE65xIvLR6MV4Axnul4xJ8UBZVYMTUNR1mw+gtkppiBhqu 95MQL9ElS1pa+B56qtJ1XBO0d+Zv+a837EUXTVt025Alb7EqK4d9axz+3GxU4jYgmvD8 X1OZYwqlg6jN7fvmC3zkMarlfoA/dzc8D4X0s3Ijw3JrasnCNeyfRqB1L7pdFx+EbS8F 6MKRVOzlyQ6YHsmN5CRML10aQ3tIRGnMA+n+qpW4D469+5dI6siHARS955DACj7USaL9 reEgta3FUj28jivpO1FYxmWO9zh1Ny+Pcyp1ObEjpyKYje2TkEXF8zbgHXUaRh/TiEtm S1yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=waIisInWVBBj6+l8uQy4Y8DNZUFi659SZcWDjk/MqDY=; b=44cXNl/B5eGtOwgQgJjhe1gBv/EKkO7ZyEw5oRtaSlYfp/QSfAKUVFcc2v1ZQsodan RL7U/UAf/3BX3Q3qNP60FMdjVheL16WBfcS+lMNm53HaQEHwldkPpS6ha+3+KPbpVolr gcj+cSBLEM2GfdqvB6tOxIoWbtqoGVSgottiXU6UZxu83AMkjUhE4U/MYFPhZaPEompR ZiUZoxdZ5QSejW0RYCC7yk7gCWTIEmG15dD5EIqzbfyCffF9Tk91Hnz25paA/FAXw8jH dQO3PMilfMU2Mg2LpBbmNMfzYA9pqRTnhyLHL63Kd3YuVjoE1fE5uE8Z4ZY1ec1shp/Q W99g== X-Gm-Message-State: ANoB5pl9pvu9pmmML3dNSSmoNd97+ddyY5ewNzVB9v0u1gbVnZv98xLk X/d2/x5Y5Afu9spxVpGMG8B9DFrQn6hdKzRyyGg= X-Google-Smtp-Source: AA0mqf6mhMXyCh/dARUvJDWVMwz0qIWb4Ulkw3j8h03AyUj6n4sD5s0bC9zop/KJyWLUsaOi0BIaSYnIhnUGseNLq70= X-Received: by 2002:a05:6808:1287:b0:359:dc32:4f9e with SMTP id a7-20020a056808128700b00359dc324f9emr37383453oiw.92.1670844383576; Mon, 12 Dec 2022 03:26:23 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 12 Dec 2022 03:26:22 -0800 In-Reply-To: X-Hashcash: 1:20:221212:emacs-devel@gnu.org::grsnluYLA5U2sf4W:2SNl Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=stefankangas@gmail.com; helo=mail-oi1-x22f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301217 Archived-At: Jo=C3=A3o T=C3=A1vora 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/is= sues/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 =3D 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.