Fix the Bootstrap check test failure on Windows. (#15975) (#15989)

(cherry picked from commit 19637143e6)

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2024-03-11 10:20:27 +02:00 committed by GitHub
parent afcebb4972
commit 6c1e0244fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,7 +119,9 @@ describe LogStash::ConfigManagement::BootstrapCheck do
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