From e475bb33eb02263cc0e5d97412297f72d1431a7e Mon Sep 17 00:00:00 2001 From: Mashhur Date: Fri, 23 Feb 2024 14:10:15 -0800 Subject: [PATCH] Fix the Bootstrap check test failure on Windows. --- x-pack/spec/config_management/bootstrap_check_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/spec/config_management/bootstrap_check_spec.rb b/x-pack/spec/config_management/bootstrap_check_spec.rb index 681b9bc6ace..27021e63690 100644 --- a/x-pack/spec/config_management/bootstrap_check_spec.rb +++ b/x-pack/spec/config_management/bootstrap_check_spec.rb @@ -119,7 +119,9 @@ end context 'when a configuration file exists in the specified location' do - let(:config_location) { Stud::Temporary.file.path } + # gsub replacement is only for Windows platform, without `gsub` `Dir.glob` cannot discover files and test fails + # note that in other `Dir.glob` places, we used `File.join/dirname` operations which doesn't create issue on Windows + let(:config_location) { Stud::Temporary.file.path.gsub("\\", "/") } it "raises a `LogStash::BootstrapCheckError` error" do expect { subject.check(settings) }.to raise_error LogStash::BootstrapCheckError