Skip to content

Commit 32463ef

Browse files
qa: don't bypass plugin manger tests on linux (#17171) (#17173)
* qa: don't bypass plugin manger tests on linux * add gradle task to build gem fixtures for integration tests (cherry picked from commit 0f81816) Co-authored-by: Ry Biesemeyer <[email protected]>
1 parent 7fec532 commit 32463ef

File tree

5 files changed

+183
-169
lines changed

5 files changed

+183
-169
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ project(":logstash-integration-tests") {
598598
systemProperty 'org.logstash.integration.specs', rubyIntegrationSpecs
599599
environment "FEATURE_FLAG", System.getenv('FEATURE_FLAG')
600600
workingDir integrationTestPwd
601-
dependsOn = [installIntegrationTestGems, copyProductionLog4jConfiguration]
601+
dependsOn installIntegrationTestGems
602+
dependsOn copyProductionLog4jConfiguration
602603
}
603604
}
604605

qa/integration/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,24 @@ clean {
6060
delete "${projectDir}/fixtures/logs_rollover/log4j2.properties"
6161
}
6262

63+
tasks.register("preparePluginTestFixtures", Exec) {
64+
65+
def fixtureDir = layout.projectDirectory.dir("fixtures/plugins")
66+
def scriptPath = fixtureDir.file("generate-gems.sh")
67+
68+
inputs.file scriptPath
69+
inputs.files fileTree(fixtureDir) { include("*.gemspec") }
70+
outputs.files fileTree(fixtureDir) { include("*.gem") }
71+
72+
commandLine = scriptPath.toString()
73+
}
74+
6375
tasks.register("integrationTests", Test) {
6476
if ((JavaVersion.current().getMajorVersion() as int) >= 17) {
6577
jvmArgs = ['--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED']
6678
}
6779
dependsOn copyProductionLog4jConfiguration
80+
dependsOn preparePluginTestFixtures
6881

6982
inputs.files fileTree("${projectDir}/services")
7083
inputs.files fileTree("${projectDir}/framework")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.gem

qa/integration/specs/cli/install_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,19 @@ def gem_in_lock_file?(pattern, lock_file)
7878
expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
7979
end
8080
end
81-
else
81+
end
8282

83-
context "with internet connection" do
84-
it "successfully install the pack" do
85-
execute = @logstash_plugin.run_raw("#{install_command} #{pack}", change_dir)
83+
context "with internet connection" do
84+
it "successfully install the pack" do
85+
execute = @logstash_plugin.run_raw("#{install_command} #{pack}", change_dir)
8686

87-
expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
88-
expect(execute.exit_code).to eq(0)
87+
expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
88+
expect(execute.exit_code).to eq(0)
8989

90-
installed = @logstash_plugin.list("logstash-output-secret")
91-
expect(installed.stderr_and_stdout).to match(/logstash-output-secret/)
90+
installed = @logstash_plugin.list("logstash-output-secret")
91+
expect(installed.stderr_and_stdout).to match(/logstash-output-secret/)
9292

93-
expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
94-
end
93+
expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
9594
end
9695
end
9796
end

0 commit comments

Comments
 (0)