Skip to content

Commit

Permalink
Fix/gems not found in integration test after plugin install (elastic#…
Browse files Browse the repository at this point in the history
…13641)

Cleanly teardown an integration test that made fall other integration tests.
In some cases the CI integration tests fails because the launched Logstash can't find a gem named `mimemagic`. This gem is installed during a CLI plugin test (install of  `logstash-input-google_cloud_storage` plugins kicks in that `mimemagic`).
  • Loading branch information
andsel authored Jan 19, 2022
1 parent 4f96a94 commit 640ba84
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qa/integration/specs/cli/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ def gem_in_lock_file?(pattern, lock_file)
let(:plugin_name) { "logstash-input-google_cloud_storage" }
let(:install_command) { "bin/logstash-plugin install" }

after(:each) do
# cleanly remove the installed plugin to don't pollute
# the environment for other subsequent tests
removal = @logstash_plugin.run_raw("bin/logstash-plugin uninstall #{plugin_name}")

expect(removal.stderr_and_stdout).to match(/Successfully removed #{plugin_name}/)
expect(removal.exit_code).to eq(0)
end

it "successfully install the plugin" do
execute = @logstash_plugin.run_raw("#{install_command} #{plugin_name}")

Expand Down

0 comments on commit 640ba84

Please sign in to comment.