From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot Date: Mon, 12 Dec 2022 11:59:09 +0100 Message-ID: <87359k7urm.fsf@gmx.de> 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="34157"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 12 12:00: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 1p4gXV-0008hV-Vo for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Dec 2022 12:00:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4gWh-0006Ce-9m; Mon, 12 Dec 2022 05:59:15 -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 1p4gWf-0006BZ-TZ for emacs-devel@gnu.org; Mon, 12 Dec 2022 05:59:13 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4gWe-0003jV-59 for emacs-devel@gnu.org; Mon, 12 Dec 2022 05:59:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1670842750; bh=871zij9ugm4fVdFf9/ODO7Sx3K8UGKrTalzE+zIpb+k=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=ShgpuCmlE/STxC89ldBureeCRTuzMC8hDmh52ZHX0/G/3XCag8MfdPWp78GJ/1qJu oPgNxKd0zDKXiuMnyDR3h3QC+UPlaCpTCkYDbOxX3Tpq7Tysm8bVi6sc10hwq5rm7O 1fNnzoeFAm+tqlpHRF1K9SW2q13/FMwRZp7KohFYe/zXpOax5V0m4YFec31seRSc6Q PdK8FN7y4BqdD0i/yBIdum/cBleQIRs6Ep4bkJRSisVcuTjo7Pi5d5jzk6WMtXMGK7 r0MUhnR+8nEiz+H2FxCfgDrsyS94y85xXm/6Tka9UOXL7j9j6HdjoIiXE8riG/YFcs A6IpJBuWoE0+A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.11]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mv2xO-1onICL45eS-00qx98; Mon, 12 Dec 2022 11:59:10 +0100 In-Reply-To: <20221212001223.E9A9DC004BE@vcs2.savannah.gnu.org> (=?utf-8?B?Ikpvw4PCo28JVMODwqF2b3JhIidz?= message of "Sun, 11 Dec 2022 19:12:23 -0500 (EST)") X-Provags-ID: V03:K1:TkhGt3hJKRttv827ETS+ISKRT81EExenYiJTaRLVvPX7hNUuStE MRL4CQZ1mwdVoIE4X25BfYQc+UKlg61FVJCFNCJolfbrtyVjSyzxu6J1urOZIwrFTSFlCPT 00A2Zxhp7VSW1Q58gTetBF1tM4KJNlQdR+XF8AjHa0jTSeB9Tr/brDtoPr1tOug3PjGPw1T gxyAlAVvSjZJygQLUJcpg== UI-OutboundReport: notjunk:1;M01:P0:g1oyaDirBQY=;2asWh74tXJGDdvJGA2DOCtrwilB 0xsl4ZBoGQiDc157+g19phHg5qZFBXrWz6PoHKynEpn8PiGS7PKBn8nJHhzmWPJLg43AuYwuN 1FyyKzIRmKS3aWdXhE6+8TO+BFUBG8gQSWrnVk/5ShI1Jh+M3QhDh/BMIfh0ro2/2BaTl7Ywr zO/0zf6HriUzDsGvIEeI31EF3f00RcsUSkA6eQYB82U4a5fqsCBoLPwQEcMfeCsS6mXutAbVu 6xValXdhTJTs6jRe5pf568dKn/nOfkSDl6yZIovOc9kV+e1DTBhu7DPOFrkgYfiKluiiQ08v8 xlQ8vcwAltsQeXtB/sEyQIbIH2aTboJTyxPrwS1PPXy7AWX4y1mFTDDl8ObVCb9JBQZowqmhO d7Kh4oGndrLOxB0J7vAS8eRCu3VYJMeJqE3ypIp3/vL3jVB6T8MWdc3wsuLWZfUbkBgpVVd9r Bk5606fkAgUR00wPSS4zVpb35vgsC1IGS7akXVjPFYqxaprsS1fxCuvsZX1yVg6wjOnPDq4Ff YJBVcGHFJI6nH3+Dzy/hk1f8DDDt7FEGACrAvYdT1SwAWexyB2s47k89ttdt3uOS/pC2/FL7c GIl/J+xOYHcfLrfF8gWc+gntbW3/z0oli1YJ4Vwchw3SpYyuNflOMfLKBoTxhRcOLMbogx335 qj+FdXK2Iy0fox+aXO1QlOvfco2RqgifI7mn1V0dUVAP3CIiyWNR3kvK13yYm0hSJmudHSIzg DMoWAuq6i8WtoI6GFSMLhYfBhbY+eobhYlWFTegEMBZgn5EA2Adb5ScX5kK0tWsnEUspEWzs Received-SPF: pass client-ip=212.227.15.19; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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:301212 Archived-At: Jo=C3=83=C2=A3o T=C3=83=C2=A1vora writes: Hi Jo=C3=A3o, (sorry for sending this email accidentially when not finished) > +(require 'tramp-sh) Do you really need this? > +(defun eglot--call-with-tramp-test (fn) > + ;; Set up a loopback TRAMP method that=E2=80=99s just a shell so the r= emote > + ;; host is really just the local host. > + (let ((tramp-remote-path (cons 'tramp-own-remote-path tramp-remote-pat= h)) > + (tramp-histfile-override t) > + (tramp-methods '(("loopback" > + (tramp-login-program "/bin/sh") > + (tramp-remote-shell "/bin/sh") > + (tramp-remote-shell-login ("-l")) > + (tramp-remote-shell-args ("-c"))))) > + (temporary-file-directory (concat "/loopback::" > + temporary-file-directory))) Pls don't do this. The better choice is to use (let* ((temporary-file-directory ert-remote-temporary-file-directory) = ...) See for example test/lisp/filenotify-tests.el, macro file-notify--deftest-r= emote > + ;; Tramp leave some buffers behind, and some time later, > + ;; `project-buffers' will trip over them causing a hard to debug > + ;; intermittent test failure somewhere else. > + (dolist (buf (buffer-list)) > + (when (string-match-p "^\\*tramp" (buffer-name buf)) > + (kill-buffer buf)))))) Just killing the buffers is not sufficient. The better way is to call tramp-cleanup-connection, like done in that macro of filenotfy-tests.el > +(ert-deftest eglot--tramp-test () > + "Ensure LSP servers can be used over TRAMP." > + (skip-unless (executable-find "clangd")) > +(ert-deftest eglot--tramp-test-2 () > + "Ensure LSP servers can be used over TRAMP." > + (skip-unless (executable-find "clangd")) Shouldn't the test be performed with bound remote default-directory? By this, you could test Tramp + Eglot also in other variatioons, like a real ssh connection. Best regards, Michael.