Skip to content

Commit

Permalink
Update offline pack tests for integration plugins
Browse files Browse the repository at this point in the history
Fix wildcard "logstash-filter-*" test
Add test for offline packaging of integaration plugins

Fixes elastic#11406
  • Loading branch information
robbavey committed Jan 10, 2020
1 parent a6369bc commit 879ec5b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion qa/integration/specs/cli/prepare_offline_pack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@
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
let(:plugins_to_pack) { %w(logstash-filter-*) }

Expand All @@ -50,7 +70,7 @@
filters = @logstash_plugin.list(plugins_to_pack.first)
.stderr_and_stdout.split("\n")
.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

expect(unpacked.plugins.collect(&:name)).to include(*filters)
Expand Down

0 comments on commit 879ec5b

Please sign in to comment.