From 3e9e03b2411d9d3208750c1c45dbfba4a39aa38f Mon Sep 17 00:00:00 2001 From: Mashhur <99575341+mashhurs@users.noreply.github.com> Date: Thu, 26 Jun 2025 14:39:31 -0700 Subject: [PATCH] Fix failed Java test and run Java unit test while compiling. (#306) * Run Java tests in unit test CIs. (cherry picked from commit f190c722b8a05ca31fc4c361d964a40007805c14) --- .ci/logstash-run.sh | 1 + Rakefile | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.ci/logstash-run.sh b/.ci/logstash-run.sh index 23f92042..22e4ea62 100755 --- a/.ci/logstash-run.sh +++ b/.ci/logstash-run.sh @@ -27,6 +27,7 @@ bundle exec rake prepare_geoip_resources if [[ "$INTEGRATION" != "true" ]]; then bundle exec rspec --format=documentation spec/unit --tag ~integration --tag ~secure_integration + bundle exec rake java_test else if [[ "$SECURE_INTEGRATION" == "true" ]]; then diff --git a/Rakefile b/Rakefile index 58824d84..710bd50a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,13 @@ require 'logstash/devutils/rake' -task :install_jars do +task :vendor do sh('./gradlew clean vendor') end + task :prepare_geoip_resources do sh('./gradlew geoipTestResources') end -task :vendor => :install_jars - -task :test do - require 'rspec' - require 'rspec/core/runner' - Rake::Task[:install_jars].invoke - Rake::Task[:generate_ssl].invoke - sh './gradlew test' - exit(RSpec::Core::Runner.run(Rake::FileList['spec/**/*_spec.rb'])) +task :java_test do + sh('./gradlew test') end \ No newline at end of file