From 55a4b100004ef086bf6f78031c9dc814194f8b10 Mon Sep 17 00:00:00 2001 From: Mashhur <99575341+mashhurs@users.noreply.github.com> Date: Wed, 6 Mar 2024 10:10:35 -0800 Subject: [PATCH] Fix the Bootstrap check test failure on Windows. (#15975) (cherry picked from commit 19637143e6ef24b7b4009e71b1fa32b04b92c942) --- 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