mirror of
https://github.com/elastic/logstash.git
synced 2025-06-28 09:46:03 -04:00
Unpin bundler, fix gem installer tests (#13762)
Fix gem installer tests to enable unpinning the version of bundler This commit removes changes the gem installer to use real gems, rather than use `allow_instance_of` during testing, which appears to be problematic with the latest version of bundler
This commit is contained in:
parent
e38b25ced3
commit
aceb682f18
6 changed files with 20 additions and 11 deletions
|
@ -307,7 +307,7 @@ tasks.register("installBundler") {
|
||||||
dependsOn assemblyDeps
|
dependsOn assemblyDeps
|
||||||
outputs.files file("${projectDir}/vendor/bundle/jruby/2.5.0/bin/bundle")
|
outputs.files file("${projectDir}/vendor/bundle/jruby/2.5.0/bin/bundle")
|
||||||
doLast {
|
doLast {
|
||||||
gem(projectDir, buildDir, "bundler", "= 2.3.6", "${projectDir}/vendor/bundle/jruby/2.5.0")
|
gem(projectDir, buildDir, "bundler", "~> 2", "${projectDir}/vendor/bundle/jruby/2.5.0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ tasks.register("installIntegrationTestBundler"){
|
||||||
dependsOn unpackTarDistribution
|
dependsOn unpackTarDistribution
|
||||||
outputs.files file("${qaBundleBin}")
|
outputs.files file("${qaBundleBin}")
|
||||||
doLast {
|
doLast {
|
||||||
gem(projectDir, buildDir, "bundler", "= 2.3.6", qaBundledGemPath)
|
gem(projectDir, buildDir, "bundler", "~> 2", qaBundledGemPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ Gem::Specification.new do |spec|
|
||||||
spec.version = "0.0.1"
|
spec.version = "0.0.1"
|
||||||
spec.authors = ["Elastic"]
|
spec.authors = ["Elastic"]
|
||||||
spec.email = ["info@elastic.co"]
|
spec.email = ["info@elastic.co"]
|
||||||
|
|
||||||
spec.summary = "a summary"
|
spec.summary = "a summary"
|
||||||
spec.description = "a description"
|
spec.description = "a description"
|
||||||
spec.homepage = "https://elastic.co"
|
spec.homepage = "https://elastic.co"
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,12 @@
|
||||||
|
# coding: utf-8
|
||||||
|
Gem::Specification.new do |spec|
|
||||||
|
spec.name = "logstash-input-packtest_pim"
|
||||||
|
spec.version = "0.0.1"
|
||||||
|
spec.authors = ["Elastic"]
|
||||||
|
spec.email = ["info@elastic.co"]
|
||||||
|
spec.post_install_message = "Hello from the friendly pack"
|
||||||
|
spec.summary = "a summary"
|
||||||
|
spec.description = "a description"
|
||||||
|
spec.homepage = "https://elastic.co"
|
||||||
|
spec.add_runtime_dependency "logstash-input-packtestdep"
|
||||||
|
end
|
|
@ -46,9 +46,7 @@ describe LogStash::PluginManager::GemInstaller do
|
||||||
let(:message) { "Hello from the friendly pack" }
|
let(:message) { "Hello from the friendly pack" }
|
||||||
|
|
||||||
context "when present" do
|
context "when present" do
|
||||||
before do
|
let(:plugin_name) { 'logstash-input-packtest_pim-0.0.1' }
|
||||||
allow_any_instance_of(::Gem::Specification).to receive(:post_install_message).and_return(message)
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when we want the message" do
|
context "when we want the message" do
|
||||||
it "display the message" do
|
it "display the message" do
|
||||||
|
@ -64,7 +62,7 @@ describe LogStash::PluginManager::GemInstaller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when not present" do
|
context "when not present" do
|
||||||
context "when we want the message" do
|
context "when we don't want the message" do
|
||||||
it "doesn't display the message" do
|
it "doesn't display the message" do
|
||||||
expect(LogStash::PluginManager.ui).not_to receive(:info).with(message)
|
expect(LogStash::PluginManager.ui).not_to receive(:info).with(message)
|
||||||
subject.install(simple_gem, true, temporary_gem_home)
|
subject.install(simple_gem, true, temporary_gem_home)
|
||||||
|
|
|
@ -29,8 +29,8 @@ describe LogStash::PluginManager::PackInstaller::Pack do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns the plugins" do
|
it "returns the plugins" do
|
||||||
expect(subject.plugins.size).to eq(1)
|
expect(subject.plugins.size).to eq(2)
|
||||||
expect(subject.plugins.collect(&:name)).to include("logstash-input-packtest")
|
expect(subject.plugins.collect(&:name)).to include("logstash-input-packtest_pim", "logstash-input-packtest")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns the dependencies" do
|
it "returns the dependencies" do
|
||||||
|
@ -39,8 +39,8 @@ describe LogStash::PluginManager::PackInstaller::Pack do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns all the gems" do
|
it "returns all the gems" do
|
||||||
expect(subject.gems.size).to eq(2)
|
expect(subject.gems.size).to eq(3)
|
||||||
expect(subject.gems.collect(&:name)).to include("logstash-input-packtest", "logstash-input-packtestdep")
|
expect(subject.gems.collect(&:name)).to include("logstash-input-packtest", "logstash-input-packtest_pim", "logstash-input-packtestdep")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue