unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot
Date: Mon, 12 Dec 2022 11:03:42 +0000	[thread overview]
Message-ID: <CALDnm53kz-9++-1xH_GK8ACKMgqbtBjbL-iiuMtPV5S7rYGQbQ@mail.gmail.com> (raw)
In-Reply-To: <87359k7urm.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]

Michael,

Feel free to do all these changes in the test/lisp/progmodes/eglot-tests.el

FWIW I didn't write many of these tests, but I didn't care to
import the full Git history as I did in lisp/progmodes/eglot.el.

João

On Mon, Dec 12, 2022 at 10:59 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> João Távora <joaotavora@gmail.com> writes:
>
> Hi João,
>
> (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’s just a shell so the remote
> > +  ;; host is really just the local host.
> > +  (let ((tramp-remote-path (cons 'tramp-own-remote-path
> tramp-remote-path))
> > +        (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-remote
>
> > +      ;; 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.
>


-- 
João Távora

[-- Attachment #2: Type: text/html, Size: 3460 bytes --]

  reply	other threads:[~2022-12-12 11:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <167080394233.4339.5863353994038854528@vcs2.savannah.gnu.org>
     [not found] ` <20221212001223.E9A9DC004BE@vcs2.savannah.gnu.org>
2022-12-12  8:34   ` emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot Stefan Kangas
2022-12-12  9:52     ` João Távora
2022-12-12 11:26       ` Stefan Kangas
2022-12-12 11:56         ` João Távora
2022-12-12 21:52           ` Stefan Kangas
2022-12-13  8:49             ` Michael Albinus
2022-12-13 19:23               ` Stefan Kangas
2022-12-14  9:55                 ` Michael Albinus
2022-12-12 10:32   ` Michael Albinus
2022-12-12 10:37     ` João Távora
2022-12-13 19:10       ` Michael Albinus
2022-12-13 20:18         ` João Távora
2022-12-14  9:57           ` Michael Albinus
2022-12-14 12:58             ` João Távora
2022-12-14 14:11               ` Michael Albinus
2022-12-14 15:46                 ` João Távora
2022-12-14 17:41                   ` Stefan Monnier
2022-12-14 21:42                   ` Stefan Kangas
2022-12-15  9:12                     ` Michael Albinus
2022-12-15 12:08                       ` João Távora
2022-12-12 10:59   ` Michael Albinus
2022-12-12 11:03     ` João Távora [this message]
2022-12-12 11:08       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALDnm53kz-9++-1xH_GK8ACKMgqbtBjbL-iiuMtPV5S7rYGQbQ@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).