From 83de04812bf803ecc27b8076d7e140c5a22612d4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 17 Feb 2022 13:39:39 +0100 Subject: [PATCH] [8.0](backport #29440) Add supported-versions and update docker-compose for logstash module (#30268) Updates logstash module tests to run on more recent and multiple logstash versions. Completely skip logstash python tests to avoid running compose scenarios for skipped tests. (cherry picked from commit 478a5ce973c9e2206bf6e84550e02fd55cb0d400) It's just a _little_ odd to have 8.1 being tested by metricbeat 8.0. But I think this will help keep backports easier. In theory it could also help ensure 8.0 metricbeat updates don't break support for 8.1 logstash monitoring. Though such changes are probably unlikely. Co-authored-by: Mat Schaffer --- .../module/logstash/_meta/supported-versions.yml | 5 +++++ metricbeat/module/logstash/docker-compose.yml | 12 ++++++------ metricbeat/module/logstash/test_logstash.py | 6 ++---- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 metricbeat/module/logstash/_meta/supported-versions.yml diff --git a/metricbeat/module/logstash/_meta/supported-versions.yml b/metricbeat/module/logstash/_meta/supported-versions.yml new file mode 100644 index 000000000000..6eed033b8adc --- /dev/null +++ b/metricbeat/module/logstash/_meta/supported-versions.yml @@ -0,0 +1,5 @@ +variants: + - LOGSTASH_VERSION: 8.1.0-aa69d697-SNAPSHOT + - LOGSTASH_VERSION: 8.0.0-rc2 + - LOGSTASH_VERSION: 7.17.1-aa300c4a-SNAPSHOT + - LOGSTASH_VERSION: 7.17.0 diff --git a/metricbeat/module/logstash/docker-compose.yml b/metricbeat/module/logstash/docker-compose.yml index ac979af974e3..26d7840ff07c 100644 --- a/metricbeat/module/logstash/docker-compose.yml +++ b/metricbeat/module/logstash/docker-compose.yml @@ -2,25 +2,25 @@ version: '2.3' services: logstash: - image: docker.elastic.co/integrations-ci/beats-logstash:${LOGSTASH_VERSION:-7.15.1}-1 + image: docker.elastic.co/integrations-ci/beats-logstash:${LOGSTASH_VERSION:-8.1.0-aa69d697-SNAPSHOT}-1 build: context: ./_meta args: - LOGSTASH_VERSION: ${LOGSTASH_VERSION:-7.15.1} + LOGSTASH_VERSION: ${LOGSTASH_VERSION:-8.1.0-aa69d697-SNAPSHOT} ports: - - 9600 + - "9600" depends_on: - elasticsearch elasticsearch: - image: docker.elastic.co/integrations-ci/beats-elasticsearch:${ELASTICSEARCH_VERSION:-7.15.1}-1 + image: docker.elastic.co/integrations-ci/beats-elasticsearch:${ELASTICSEARCH_VERSION:-8.1.0-aa69d697-SNAPSHOT}-1 build: context: ../elasticsearch/_meta args: - ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION:-7.15.1} + ELASTICSEARCH_VERSION: ${ELASTICSEARCH_VERSION:-8.1.0-aa69d697-SNAPSHOT} environment: - "network.host=" - "transport.host=127.0.0.1" - "http.host=0.0.0.0" ports: - - 9200 + - "9200" diff --git a/metricbeat/module/logstash/test_logstash.py b/metricbeat/module/logstash/test_logstash.py index 994983c9d85c..6b6f92d35685 100644 --- a/metricbeat/module/logstash/test_logstash.py +++ b/metricbeat/module/logstash/test_logstash.py @@ -10,6 +10,8 @@ import urllib.request +@metricbeat.parameterized_with_supported_versions +@unittest.skip("Unsure which fields can be deleted") class Test(metricbeat.BaseTest): COMPOSE_SERVICES = ['logstash'] @@ -20,8 +22,6 @@ def test_node(self): """ logstash node metricset test """ - unittest.skip('Skipping this test to check documented fields. We will unskip once we know which fields can be deleted') - return self.check_metricset("logstash", "node", self.get_hosts(), self.FIELDS + ["process"]) @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test") @@ -30,8 +30,6 @@ def test_node_stats(self): """ logstash node_stats metricset test """ - unittest.skip('Skipping this test to check documented fields. We will unskip once we know which fields can be deleted') - return self.check_metricset("logstash", "node_stats", self.get_hosts(), self.FIELDS) @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")