Subject: Re: bug#79056: tab-bar-tests-quit-restore-window sometimes fails in *compilation* buffer

From: Juri Linkov <[email-masked]>
Date: Tue, 22 Jul 2025 09:38:35 +0300

> I don't know what the test is trying to do, but when it's noninteractive 
> why does the test access /dev/tty or need TERM? /dev/tty and TERM 
> ordinarily ought to be irrelevant and unused in a noninteractive test.
>
> How about something like the following patch?
>
> @@ -52,15 +52,7 @@ tab-bar-tests-close-other-tabs-with-arg
> -  (skip-when (pcase system-type
> -               ;; Skip test on MS-Windows in batch mode, since terminal
> -               ;; frames cannot be created in that case.
> -               ('windows-nt noninteractive)
> -               ;; Emba runs the container without "--tty"
> -               ;; (the environment variable "TERM" is nil), and this
> -               ;; test fails with '(error "Could not open file: /dev/tty")'.
> -               ;; Therefore skip it unless it can use '(tty-type . "linux")'.
> -               ('gnu/linux (null (getenv "TERM")))))
> +  (skip-when (or noninteractive (null (getenv "TERM"))))

If there is no reliable way to create terminal frames in noninteractive
tests, then probably such tests should be skipped by default to be used
only manually when someone will remember to run them periodically.

PS: Many web browsers support headless mode that is used in test automation.
I wonder how it would be possible to implement headless mode in Emacs?