Skip to content

Commit

Permalink
Fix flaky logstash-plugin IT test (elastic#15803)
Browse files Browse the repository at this point in the history
This commit fixes the flaky IT test:
`install non bundle plugin successfully installs the plugin with debug enabled`
by being a bit more lenient with the output which can get garbled by Bundler.

Closes elastic#15801
  • Loading branch information
dliappis authored Jan 18, 2024
1 parent 2c83a52 commit fc09ad4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions qa/integration/specs/cli/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def gem_in_lock_file?(pattern, lock_file)
content.match(pattern)
end

# Bundler can mess up installation successful output: https://github.com/elastic/logstash/issues/15801
INSTALL_SUCCESS_RE = /IB?nstall successful/
INSTALLATION_SUCCESS_RE = /IB?nstallation successful/

describe "CLI > logstash-plugin install" do
before(:all) do
@fixture = Fixture.new(__FILE__)
Expand Down Expand Up @@ -65,7 +69,7 @@ def gem_in_lock_file?(pattern, lock_file)
it "successfully install the pack" do
execute = @logstash_plugin.run_raw("#{offline_wrapper_cmd} #{install_command} #{pack}", change_dir)

expect(execute.stderr_and_stdout).to match(/Install successful/)
expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
expect(execute.exit_code).to eq(0)

installed = @logstash_plugin.list("logstash-output-secret")
Expand All @@ -80,7 +84,7 @@ def gem_in_lock_file?(pattern, lock_file)
it "successfully install the pack" do
execute = @logstash_plugin.run_raw("#{install_command} #{pack}", change_dir)

expect(execute.stderr_and_stdout).to match(/Install successful/)
expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
expect(execute.exit_code).to eq(0)

installed = @logstash_plugin.list("logstash-output-secret")
Expand Down Expand Up @@ -131,7 +135,7 @@ def gem_in_lock_file?(pattern, lock_file)
it "successfully install the plugin" do
execute = @logstash_plugin.run_raw("#{install_command} #{plugin_name}")

expect(execute.stderr_and_stdout).to match(/Installation successful/)
expect(execute.stderr_and_stdout).to match(INSTALLATION_SUCCESS_RE)
expect(execute.exit_code).to eq(0)

installed = @logstash_plugin.list(plugin_name)
Expand All @@ -141,7 +145,7 @@ def gem_in_lock_file?(pattern, lock_file)
it "successfully installs the plugin with debug enabled" do
execute = @logstash_plugin.run_raw("#{install_command} #{plugin_name}", true, {"DEBUG" => "1"})

expect(execute.stderr_and_stdout).to match(/Installation successful/)
expect(execute.stderr_and_stdout).to match(INSTALLATION_SUCCESS_RE)
expect(execute.exit_code).to eq(0)

installed = @logstash_plugin.list(plugin_name)
Expand Down

0 comments on commit fc09ad4

Please sign in to comment.