Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #9068 to 6.x: Add tests for etcd 3.3 on metricbeat module #9094

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ https://github.com/elastic/beats/compare/v6.5.0...6.x[Check the HEAD diff]
*Metricbeat*

- Collect custom cluster `display_name` in `elasticsearch/cluster_stats` metricset. {pull}8445[8445]
- Test etcd module with etcd 3.3. {pull}9068[9068]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't add entries for tests, as these doesn't make it into the product itself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I wanted to mention it as indication of coverage for this version, as changed in the docs too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I'm ok with changing or removing it in a future PR as this is already in master, wdyt?


*Packetbeat*

Expand Down
6 changes: 6 additions & 0 deletions metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ services:
etcd:
build: ./module/etcd/_meta

etcd_3_2:
build:
context: ./module/etcd/_meta
args:
ETCD_VERSION: v3.2.25

haproxy:
build: ./module/haproxy/_meta

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/modules/etcd.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The default metricsets are `leader`, `self` and `store`.
[float]
=== Compatibility

The etcd module is tested with etcd 3.2.
The etcd module is tested with etcd 3.2 and 3.3.


[float]
Expand Down
3 changes: 2 additions & 1 deletion metricbeat/module/etcd/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM quay.io/coreos/etcd:v3.2
ARG ETCD_VERSION=v3.3.10
FROM quay.io/coreos/etcd:$ETCD_VERSION
HEALTHCHECK --interval=1s --retries=90 CMD wget -O - http://localhost:2379/health | grep true
CMD ["/usr/local/bin/etcd", "--advertise-client-urls", "http://0.0.0.0:2379,http://0.0.0.0:4001", "--listen-client-urls", "http://0.0.0.0:2379,http://0.0.0.0:4001"]
2 changes: 1 addition & 1 deletion metricbeat/module/etcd/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ The default metricsets are `leader`, `self` and `store`.
[float]
=== Compatibility

The etcd module is tested with etcd 3.2.
The etcd module is tested with etcd 3.2 and 3.3.
33 changes: 33 additions & 0 deletions metricbeat/module/etcd/test_etcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
import sys
import unittest
import time
from parameterized import parameterized

sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system'))

import metricbeat


class Test(metricbeat.BaseTest):
COMPOSE_SERVICES = ['etcd']

@parameterized.expand([
"leader",
"self",
"store",
])
@unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")
def test_metricset(self, metricset):
"""
etcd metricset tests
"""
self.check_metricset("etcd", metricset, self.get_hosts(), ['etcd.' + metricset])

def get_hosts(self):
return [self.compose_hosts()[0] + ':' +
os.getenv('ETCD_PORT', '2379')]


class Test_3_2(Test):
COMPOSE_SERVICES = ['etcd_3_2']