Skip to content

Commit

Permalink
qa: don't bypass plugin manger tests on linux (#17171)
Browse files Browse the repository at this point in the history
* qa: don't bypass plugin manger tests on linux

* add gradle task to build gem fixtures for integration tests
  • Loading branch information
yaauie authored Feb 27, 2025
1 parent 793e8c0 commit 0f81816
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 169 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ project(":logstash-integration-tests") {
systemProperty 'org.logstash.integration.specs', rubyIntegrationSpecs
environment "FEATURE_FLAG", System.getenv('FEATURE_FLAG')
workingDir integrationTestPwd
dependsOn = [installIntegrationTestGems, copyProductionLog4jConfiguration]
dependsOn installIntegrationTestGems
dependsOn copyProductionLog4jConfiguration
}
}

Expand Down
13 changes: 13 additions & 0 deletions qa/integration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,24 @@ clean {
delete "${projectDir}/fixtures/logs_rollover/log4j2.properties"
}

tasks.register("preparePluginTestFixtures", Exec) {

def fixtureDir = layout.projectDirectory.dir("fixtures/plugins")
def scriptPath = fixtureDir.file("generate-gems.sh")

inputs.file scriptPath
inputs.files fileTree(fixtureDir) { include("*.gemspec") }
outputs.files fileTree(fixtureDir) { include("*.gem") }

commandLine = scriptPath.toString()
}

tasks.register("integrationTests", Test) {
if ((JavaVersion.current().getMajorVersion() as int) >= 17) {
jvmArgs = ['--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED']
}
dependsOn copyProductionLog4jConfiguration
dependsOn preparePluginTestFixtures

inputs.files fileTree("${projectDir}/services")
inputs.files fileTree("${projectDir}/framework")
Expand Down
1 change: 1 addition & 0 deletions qa/integration/fixtures/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gem
19 changes: 9 additions & 10 deletions qa/integration/specs/cli/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,19 @@ def gem_in_lock_file?(pattern, lock_file)
expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
end
end
else
end

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

expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
expect(execute.exit_code).to eq(0)
expect(execute.stderr_and_stdout).to match(INSTALL_SUCCESS_RE)
expect(execute.exit_code).to eq(0)

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

expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
end
expect(gem_in_lock_file?(/gemoji/, @logstash.lock_file)).to be_truthy
end
end
end
Expand Down
Loading

0 comments on commit 0f81816

Please sign in to comment.