ruby-changes:69562
From: Yusuke <ko1@a...>
Date: Tue, 2 Nov 2021 17:32:08 +0900 (JST)
Subject: [ruby-changes:69562] 905b6aaa7c (master): test/readline/test_readline.rb: Use TERM=vt100 to run the tests
https://git.ruby-lang.org/ruby.git/commit/?id=905b6aaa7c From 905b6aaa7c5d327ab14bc7eaec13de5a34a82753 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Tue, 2 Nov 2021 17:28:23 +0900 Subject: test/readline/test_readline.rb: Use TERM=vt100 to run the tests Readline seems to emit an escape sequence `"\e[?1034h` at an unpredictable timing when `TERM=xterm` or something. This leads to a noisy random test failure. http://rubyci.s3.amazonaws.com/amazon2/ruby-master/log/20211102T063005Z.fail.html.gz ``` 1) Failure: TestReadline#test_modify_text_in_pre_input_hook [/home/chkbuild/chkbuild/tmp/build/20211102T063005Z/ruby/test/readline/test_readline.rb:404]: <"> hello world\n"> expected but was <"\e[?1034h> hello world\n">. ``` This test is for Ruby's readline extension, not for readline library itself. So here this change force to use "TERM=vt100" to run the tests. --- test/readline/test_readline.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index a0438aa1fdf..2dc5de756a4 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -7,6 +7,7 @@ require "open3" https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L7 module BasetestReadline INPUTRC = "INPUTRC" + TERM = "TERM" SAVED_ENV = %w[COLUMNS LINES] TIMEOUT = 8 @@ -14,10 +15,12 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L15 def setup @saved_env = ENV.values_at(*SAVED_ENV) @inputrc, ENV[INPUTRC] = ENV[INPUTRC], IO::NULL + @term, ENV[TERM] = ENV[TERM], "vt100" end def teardown ENV[INPUTRC] = @inputrc + ENV[TERM] = @term Readline.instance_variable_set("@completion_proc", nil) begin Readline.delete_text -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/