summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-03-20 15:01:48 +0900
committernagachika <nagachika@ruby-lang.org>2021-03-20 15:01:48 +0900
commitc02f4c1c5aa5056d6eae8f0c2d6414adf5293b2b (patch)
treee5638a7a087046fc8fce2543f9a4ed4004f6c47e
parentd84cc717020be1da7d89b6bda02d1427f9593968 (diff)
merge revision(s) e0dd072978e6c2c8180e75617e7ee37830caefa3,85f99f4b715a5954124d5014002c16652995b128:
Fix errors when XDG_CONFIG_HOME points to non-writable directory `$HOME/.config` is not writable on CI because I think tests should not corrupt user's data. And GitHub Actions CI sets `XDG_CONFIG_HOME` since `Version: 20210309.1`. https://github.com/ruby/actions/runs/2130811016?check_suite_focus=true#step:16:301 ``` Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb ``` --- test/irb/test_cmd.rb | 2 ++ 1 file changed, 2 insertions(+) Try to fix errors in TestIRB::TestHistory too https://github.com/ruby/actions/runs/2137935523?check_suite_focus=true#step:9:562 ``` 1) Error: TestIRB::TestHistory#test_history_concurrent_use: Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb /home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `mkdir' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `fu_mkdir' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:231:in `block (2 levels) in mkdir_p' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `reverse_each' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `block in mkdir_p' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `each' /home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `mkdir_p' /home/runner/work/actions/actions/ruby/lib/irb/init.rb:355:in `rc_file_generators' /home/runner/work/actions/actions/ruby/lib/irb/init.rb:330:in `rc_file' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:170:in `block in assert_history' /home/runner/work/actions/actions/ruby/lib/tmpdir.rb:96:in `mktmpdir' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:168:in `assert_history' /home/runner/work/actions/actions/ruby/test/irb/test_history.rb:133:in `test_history_concurrent_use' ``` --- test/irb/test_history.rb | 2 ++ 1 file changed, 2 insertions(+)
-rw-r--r--test/irb/test_cmd.rb2
-rw-r--r--test/irb/test_history.rb2
-rw-r--r--version.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index bb33f535b6..d0f1ac645c 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -17,12 +17,14 @@ module TestIRB
Dir.chdir(@tmpdir)
@home_backup = ENV["HOME"]
ENV["HOME"] = @tmpdir
+ @xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME")
@default_encoding = [Encoding.default_external, Encoding.default_internal]
@stdio_encodings = [STDIN, STDOUT, STDERR].map {|io| [io.external_encoding, io.internal_encoding] }
IRB.instance_variable_get(:@CONF).clear
end
def teardown
+ ENV["XDG_CONFIG_HOME"] = @xdg_config_home_backup
ENV["HOME"] = @home_backup
Dir.chdir(@pwd)
FileUtils.rm_rf(@tmpdir)
diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb
index 392a6afa9a..1ba4d2e515 100644
--- a/test/irb/test_history.rb
+++ b/test/irb/test_history.rb
@@ -132,6 +132,7 @@ module TestIRB
def assert_history(expected_history, initial_irb_history, input)
backup_verbose, $VERBOSE = $VERBOSE, nil
backup_home = ENV["HOME"]
+ backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME")
IRB.conf[:LC_MESSAGES] = IRB::Locale.new
actual_history = nil
Dir.mktmpdir("test_irb_history_#{$$}") do |tmpdir|
@@ -160,6 +161,7 @@ module TestIRB
ensure
$VERBOSE = backup_verbose
ENV["HOME"] = backup_home
+ ENV["XDG_CONFIG_HOME"] = backup_xdg_config_home
end
def with_temp_stdio
diff --git a/version.h b/version.h
index 0c5807b1a6..21f37b93dd 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 3
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 171
+#define RUBY_PATCHLEVEL 172
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 3