Subject: Re: bug#29187: flymake ruby and perl tests fail on rhel7.4

From: [email-masked] (João Távora)
Date: Tue, 07 Nov 2017 15:57:29 +0000

Glenn Morris <[email-masked]> writes:

> João Távora wrote:
>
>> Dmitry Gutov <[email-masked]> writes:
> [...]
>>> It also fails here via 'make check' (with Ruby 1.9.3) but succeeds
>>> interactively.
>
> Same here.

This is bizarre, because I did manage to reproduce and fix, on a
separate Ubuntu machine I have access to, one of the errors that you
had, Glenn, and that was indeed due to the extra diagnostic line
produced by your perl.

But I don't get any differences between interactive and non-interactive
cases and I can't understand how your test run could possibly have
succeeded interactively since it produces that same extra line.

Dmitry, your case baffles me even more. Are you sure you get the exact
same output as Glenn?

Perhaps there's something strange and we might be dealing with different
problems. Let's perhaps first agree to run tests in a common
manner. Interactively:

   $ src/emacs -Q --eval "(setq load-prefer-newer t)" -l test/lisp/progmodes/flymake-tests.el --eval "(ert \"\")"

and non-interactively (make check also works, obviuosly)

   $ src/emacs -Q --eval "(setq load-prefer-newer t)" -l test/lisp/progmodes/flymake-tests.el --batch --eval "(ert-run-tests-batch-and-exit \"\")"

I get the same results in either case, no failures.

Now Glenn, can you try those 2 tests again after applying this patch to
flymake-tests.el? The first part should theoretically fix your perl
failure and the second part should help me understand if launching ruby
failed.

diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el
index c60f910034..98c74624b5 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -114,13 +114,16 @@ flymake-tests--wait-for-backends
   (flymake-tests--with-flymake ("test.pl")
     (flymake-goto-next-error)
     (should (eq 'flymake-warning (face-at-point)))
-    (flymake-goto-next-error)
+    (goto-char (point-max))
+    (flymake-goto-prev-error)
     (should (eq 'flymake-error (face-at-point)))))
 
 (ert-deftest ruby-backend ()
   "Test the ruby backend"
   (skip-unless (executable-find "ruby"))
   (flymake-tests--with-flymake ("test.rb")
+    (if (memq 'ruby-flymake (flymake-disabled-backends))
+        (ert-fail "Something went wrong setting up ruby flymake"))
     (flymake-goto-next-error)
     (should (eq 'flymake-warning (face-at-point)))
     (flymake-goto-next-error)