From cf71dae3ff1a4352b6efc9055fd7148ba33a6dd6 Mon Sep 17 00:00:00 2001 From: Andres Rodriguez Date: Fri, 3 Nov 2023 12:08:01 -0400 Subject: [PATCH] Add support to test unsupported plugins (#15526) Add support to test unsupported plugins. Only enable input-rss for now. --- .../supported_plugins_test_pipeline.yml | 24 ++++++++++++------- ...t_supported_plugins.rb => test_plugins.rb} | 9 ++++--- ...t_supported_plugins.sh => test_plugins.sh} | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-) rename ci/{test_supported_plugins.rb => test_plugins.rb} (96%) rename ci/{test_supported_plugins.sh => test_plugins.sh} (83%) diff --git a/.buildkite/supported_plugins_test_pipeline.yml b/.buildkite/supported_plugins_test_pipeline.yml index b913f41223f..f348d50f5d8 100644 --- a/.buildkite/supported_plugins_test_pipeline.yml +++ b/.buildkite/supported_plugins_test_pipeline.yml @@ -9,24 +9,30 @@ steps: key: "tier1_plugins" steps: - label: "Test Tier1 inputs" - command: ./ci/test_supported_plugins.sh -t tier1 -k input + command: ./ci/test_plugins.sh -t tier1 -k input - label: "Test Tier1 filters" - command: ./ci/test_supported_plugins.sh -t tier1 -k filter + command: ./ci/test_plugins.sh -t tier1 -k filter - label: "Test Tier1 codecs" - command: ./ci/test_supported_plugins.sh -t tier1 -k codec + command: ./ci/test_plugins.sh -t tier1 -k codec - label: "Test Tier1 outputs" - command: ./ci/test_supported_plugins.sh -t tier1 -k output + command: ./ci/test_plugins.sh -t tier1 -k output - label: "Test Tier1 integrations" - command: ./ci/test_supported_plugins.sh -t tier1 -k integration + command: ./ci/test_plugins.sh -t tier1 -k integration - group: "Tier2 plugins test group" key: "tier2_plugins" steps: - label: "Test Tier2 inputs" - command: ./ci/test_supported_plugins.sh -t tier2 -k input + command: ./ci/test_plugins.sh -t tier2 -k input - label: "Test Tier2 filters" - command: ./ci/test_supported_plugins.sh -t tier2 -k filter + command: ./ci/test_plugins.sh -t tier2 -k filter - label: "Test Tier2 codecs" - command: ./ci/test_supported_plugins.sh -t tier2 -k codec + command: ./ci/test_plugins.sh -t tier2 -k codec - label: "Test Tier2 outputs" - command: ./ci/test_supported_plugins.sh -t tier2 -k output + command: ./ci/test_plugins.sh -t tier2 -k output + + - group: "Unsupported plugins test group" + key: "unsupported_plugins" + steps: + - label: "Test unsupported inputs" + command: ./ci/test_plugins.sh -t unsupported -k input diff --git a/ci/test_supported_plugins.rb b/ci/test_plugins.rb similarity index 96% rename from ci/test_supported_plugins.rb rename to ci/test_plugins.rb index 91c1adc1f86..b914de24d6a 100644 --- a/ci/test_supported_plugins.rb +++ b/ci/test_plugins.rb @@ -139,6 +139,9 @@ def install_gem(gem_file) "logstash-codec-msgpack", "logstash-codec-netflow"], :filter => ["logstash-filter-aggregate", "logstash-filter-de_dot", "logstash-filter-throttle"], :output => ["logstash-output-csv", "logstash-output-graphite"] + }, + :unsupported => { + :input => ["logstash-input-rss"] } } @@ -148,7 +151,7 @@ def validate_options!(options) options[:tiers].map! { |v| v.to_sym } if options[:tiers] options[:kinds].map! { |v| v.to_sym } if options[:kinds] - raise "Invalid tier name expected tier1 or tier2" if options[:tiers] && !(options[:tiers] - [:tier1, :tier2]).empty? + raise "Invalid tier name expected tier1, tier2 or unsupported" if options[:tiers] && !(options[:tiers] - [:tier1, :tier2, :unsupported]).empty? raise "Invalid kind name expected input, codec, filter, output, integration" if options[:kinds] && !(options[:kinds] - [:input, :codec, :filter, :output, :integration]).empty? end @@ -169,7 +172,7 @@ def select_plugins_by_opts(options) if options[:plugin] select_plugins << options[:plugin] else - selected_tiers = options.fetch(:tiers, [:tier1, :tier2]) + selected_tiers = options.fetch(:tiers, [:tier1, :tier2, :unsupported]) selected_kinds = options.fetch(:kinds, [:input, :codec, :filter, :output, :integration]) select_plugins = select_plugins + select_by_tiers_and_kinds(selected_tiers, selected_kinds) end @@ -199,7 +202,7 @@ def setup_logstash_for_development end option_parser = OptionParser.new do |opts| - opts.on '-t', '--tiers tier1, tier2', Array, 'Use to select which tier to test. If no provided mean "all"' + opts.on '-t', '--tiers tier1, tier2, unsupported', Array, 'Use to select which tier to test. If no provided mean "all"' opts.on '-k', '--kinds input, codec, filter, output', Array, 'Use to select which kind of plugin to test. If no provided mean "all"' opts.on '-pPLUGIN', '--plugin=PLUGIN', 'Use to select a specific plugin, conflict with either -t and -k' opts.on '-h', '--halt', 'Halt immediately on first error' diff --git a/ci/test_supported_plugins.sh b/ci/test_plugins.sh similarity index 83% rename from ci/test_supported_plugins.sh rename to ci/test_plugins.sh index 6278907cb18..0814afd2b1c 100755 --- a/ci/test_supported_plugins.sh +++ b/ci/test_plugins.sh @@ -4,4 +4,4 @@ export GRADLE_OPTS="-Xmx4g -Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false ./gradlew assemble -bin/ruby ci/test_supported_plugins.rb $@ \ No newline at end of file +bin/ruby ci/test_plugins.rb $@