all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: emacs-29 9c0d7bb73b 2/2: Add automated tests for Eglot
Date: Wed, 14 Dec 2022 15:11:05 +0100	[thread overview]
Message-ID: <87r0x2axdy.fsf@gmx.de> (raw)
In-Reply-To: <CALDnm50JX=kYSuX+caBX8PX7VqfYgkNz_u-nd8VqChc3a3FU4g@mail.gmail.com> ("João Távora"'s message of "Wed, 14 Dec 2022 12:58:52 +0000")

João Távora <joaotavora@gmail.com> writes:

Hi João,

> Thanks.  But shouldn't it be "eglot-tests" (with trailing 's') to
> match the 
> file name eglot-tests.el?  I'm sorry I didn't notice this before.

Both conventions are used: <package>-test-FOO and <package>-tests-FOO.
In the test/ subdirectory, (dired-do-find-regexp "deftest.*-tests-")
returns 1073 lines, and (dired-do-find-regexp "deftest.*-test-") returns
1245 lines. If you prefer the "eglot-tests" prefix, rename it (I really
don't care :-)

> Also another comment about your earlier commit.
>
> +        (temporary-file-directory
> ert-remote-temporary-file-directory))
> +    ;; We must check the remote LSP server.  So far, just "clangd" is
> used.
> +    (let ((default-directory temporary-file-directory))
> +      (unless (executable-find "clangd" 'remote)
> +        (ert-skip "Remote clangd not found")))
> +    (funcall fn)))
>
> I don't think it's correct to check for "clangd" specifically in
> 'eglot--call-with-tramp-test', because that restricts its usefulness.

Yes. That's why I have added the comment. As soon as we check for other
LSP servers but "clangd", it must be changed.

> Isn't the following better and still correct?
>
> diff --git a/test/lisp/progmodes/eglot-tests.el
> b/test/lisp/progmodes/eglot-tests.el
> index d8c9560f5b..509e7e7d82 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -1265,20 +1265,25 @@ eglot--call-with-tramp-test
>           (tramp-verbose 1)
>           (temporary-file-directory
> ert-remote-temporary-file-directory)
>           (default-directory temporary-file-directory))
> -    ;; We must check the remote LSP server.  So far, just "clangd" is
> used.
> -    (unless (executable-find "clangd" 'remote)
> -      (ert-skip "Remote clangd not found"))
>      (funcall fn)))
>  
> +(cl-defmacro eglot--with-tramp-test (() &body body)
> +  (declare (indent 1) (debug t))
> +  `(eglot--call-with-tramp-test (lambda () ,@body)))
> +
>  (ert-deftest eglot-test-tramp-test ()
>    "Ensure LSP servers can be used over TRAMP."
>    :tags '(:expensive-test)
> -  (eglot--call-with-tramp-test
> #'eglot-tests--auto-detect-running-server-1))
> +  (eglot--with-tramp-test ()
> +    (skip-unless (executable-find "clangd" 'remote))
> +    (eglot-tests--auto-detect-running-server-1)))
>  
>  (ert-deftest eglot-test-tramp-test-2 ()
>    "Ensure LSP servers can be used over TRAMP."
>    :tags '(:expensive-test)
> -  (eglot--call-with-tramp-test #'eglot-tests--lsp-abiding-column-1))
> +  (eglot--with-tramp-test ()
> +    (skip-unless (executable-find "clangd" 'remote))
> +    (eglot-tests--lsp-abiding-column-1)))
>  
>  (ert-deftest eglot-test-path-to-uri-windows ()
>    (skip-unless (eq system-type 'windows-nt))

Might work. You could also remove function eglot--call-with-tramp-test,
and move its body into the macro eglot--with-tramp-test. I don't know
whether skip-unless then still works (it is applicable inside
ert-deftest only), but you could replace its call by ert-skip as I have done.

> I won't go into it except to note that if you were to apply this
> patch:
>
> @@ -1317,4 +1317,5 @@ eglot-test-same-server-multi-mode
>  
>  ;; Local Variables:
>  ;; checkdoc-force-docstrings-flag: nil
> +;; read-symbol-shorthands: (("et-" . "eglot-tests-"))
>  ;; End:
>
> then you could just type _and_ read `et-` every time and
> the symbol et-foo would be read and interned as 
> eglot-tests-foo.  And you could keep longhand mentions
> to eglot-tests-foo in there as well, and they would also map
> to the same symbol.
>
> But this is not allowed practice yet in the Emacs repo.
> Unfortunately, IMO.

I've followed the discussion about shorthands a little bit, but I have
no opinion about it.

> João

Best regards, Michael.



  reply	other threads:[~2022-12-14 14:11 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=87r0x2axdy.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.