Update offline pack tests for integration plugins

Fix wildcard "logstash-filter-*" test
Add test for offline packaging of integaration plugins

Fixes #11406
This commit is contained in:
Rob Bavey 2020-01-07 15:37:23 -05:00 committed by Robert Bavey
parent f06c5ef806
commit 60a7cd1de2

View file

@ -35,6 +35,26 @@ describe "CLI > logstash-plugin prepare-offline-pack" do
end end
end end
context "creating a pack for integration plugins" do
let(:plugin_to_pack) { "logstash-integration-jdbc" }
it "successfully create a pack" do
execute = @logstash_plugin.prepare_offline_pack(plugin_to_pack, temporary_zip_file)
expect(execute.exit_code).to eq(0)
expect(execute.stderr_and_stdout).to match(/Offline package created at/)
expect(execute.stderr_and_stdout).to match(/#{temporary_zip_file}/)
unpacked = unpack(temporary_zip_file)
expect(unpacked.plugins.collect(&:name)).to include(plugin_to_pack)
expect(unpacked.plugins.size).to eq(1)
expect(unpacked.dependencies.size).to be > 0
end
end
context "create a pack from a wildcard" do context "create a pack from a wildcard" do
let(:plugins_to_pack) { %w(logstash-filter-*) } let(:plugins_to_pack) { %w(logstash-filter-*) }
@ -50,7 +70,7 @@ describe "CLI > logstash-plugin prepare-offline-pack" do
filters = @logstash_plugin.list(plugins_to_pack.first) filters = @logstash_plugin.list(plugins_to_pack.first)
.stderr_and_stdout.split("\n") .stderr_and_stdout.split("\n")
.delete_if do |line| .delete_if do |line|
line =~ /cext|JAVA_OPT|fatal|^WARNING|Option \w+ was deprecated/ line =~ /cext|├──|└──|logstash-integration|JAVA_OPT|fatal|^WARNING|Option \w+ was deprecated/
end end
expect(unpacked.plugins.collect(&:name)).to include(*filters) expect(unpacked.plugins.collect(&:name)).to include(*filters)