Skip to content

Commit

Permalink
Do not rely on an specific memcached version for autodiscover test (e…
Browse files Browse the repository at this point in the history
…lastic#8656)

Old versions are sometimes removed, as this test is not about the module
itself we can use the latest tag here
  • Loading branch information
exekias authored Oct 19, 2018
1 parent 450071d commit b2ba2ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions metricbeat/tests/system/test_autodiscover.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_docker(self):
'docker': {
'templates': '''
- condition:
equals.docker.container.image: memcached:1.5.3
equals.docker.container.image: memcached:latest
config:
- module: memcached
metricsets: ["stats"]
Expand All @@ -37,8 +37,8 @@ def test_docker(self):
)

proc = self.start_beat()
docker_client.images.pull('memcached:1.5.3')
container = docker_client.containers.run('memcached:1.5.3', detach=True)
docker_client.images.pull('memcached:latest')
container = docker_client.containers.run('memcached:latest', detach=True)

self.wait_until(lambda: self.log_contains('Starting runner: memcached'))

Expand All @@ -51,7 +51,7 @@ def test_docker(self):
proc.check_kill_and_wait()

# Check metadata is added
assert output[0]['docker']['container']['image'] == 'memcached:1.5.3'
assert output[0]['docker']['container']['image'] == 'memcached:latest'
assert output[0]['docker']['container']['labels'] == {}
assert 'name' in output[0]['docker']['container']

Expand All @@ -74,13 +74,13 @@ def test_docker_labels(self):
)

proc = self.start_beat()
docker_client.images.pull('memcached:1.5.3')
docker_client.images.pull('memcached:latest')
labels = {
'co.elastic.metrics/module': 'memcached',
'co.elastic.metrics/period': '1s',
'co.elastic.metrics/hosts': "'${data.host}:11211'",
}
container = docker_client.containers.run('memcached:1.5.3', labels=labels, detach=True)
container = docker_client.containers.run('memcached:latest', labels=labels, detach=True)

self.wait_until(lambda: self.log_contains('Starting runner: memcached'))

Expand All @@ -93,5 +93,5 @@ def test_docker_labels(self):
proc.check_kill_and_wait()

# Check metadata is added
assert output[0]['docker']['container']['image'] == 'memcached:1.5.3'
assert output[0]['docker']['container']['image'] == 'memcached:latest'
assert 'name' in output[0]['docker']['container']

0 comments on commit b2ba2ea

Please sign in to comment.