Subject: bug#61637: 30.0.50; Fix Eglot tests that need HOME=~USER

From: João Távora <[email-masked]>
Date: Sat, 04 Mar 2023 19:35:46 +0000

Basil Contovounesios <[email-masked]> writes:

> Based on the test failures I've been seeing for months and tried to
> address in the original patches (not all of which are due to an
> unexpected HOME setting), it feels like that's probably too optimistic a
> conclusion in the general case.

If you have described those somewhere, I haven't had a chance to look,
but I'm interested.

Anyway, the other changes of your original patch are fine.  You can
just push them if they make tests more robust.

> A lot of the relevant tooling places its configuration directly under
> HOME for example, not under XDG_CONFIG_HOME.

As far as I recall, the only LSP server that relied significantly on
user-wide configuration is pyls, and it was fixed via XDG_CONFIG_HOME.
When that change made it in (in the old Github repo), this was the
commit message:

    Close #441: shield tests from some user customizations
    
    Users' customization of Python indenting style in the standard
    XDG_CONFIG_HOME location of ~/.config/pycodestyle could cause spurious
    test failures. We prevent this and similar problems by overriding that
    environment variable in tests. If this turns out to hurt other
    language servers used in the test suite, we'll have to revisit.

See https://github.com/joaotavora/eglot/issues/441 for more.

I can't recall other servers -- used in eglot-tests.el -- that suffer
from the same effect (at least to the point of that effect being
relevant).

> I can also imagine user-specific settings affecting some of the
> auto-formatting functionality tested in eglot-tests.el.

Yes, but as I said these things are much more commonly set per-project
(via eglot-workspace-configuration) or on server invocation (via
:initializationOptions) than in a user HOME directory.  Makes sense, no?
Every project has its practices, etc.

João