From 7d1c61e942f121a851228612b50b63f18daecd16 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 14:33:47 +0100 Subject: [PATCH] Add supported-versions and update docker-compose for logstash module (#29440) (#30269) 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) 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 f9e0d8739465..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.12.0}-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.12.0} + 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.12.0}-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.12.0} + 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")