Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Test only the numeric part of the process version (#214)
Browse files Browse the repository at this point in the history
When testing the version of the running Elasticsearch process,
don't consider suffix components like "-alpha1".

Fixes #213
  • Loading branch information
ninaspitfire authored and mgreau committed Nov 9, 2018
1 parent 5ae026e commit a625c8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions tests/constants.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Elasticsearch():

def __init__(self):
self.version = run('./bin/elastic-version', stdout=PIPE).stdout.decode().strip()
self.version_number = self.version.split('-', 1)[0] # '7.0.0-alpha1-SNAPSHOT' -> '7.0.0'
self.flavor = pytest.config.getoption('--image-flavor')
self.url = 'http://localhost:9200'

Expand Down
6 changes: 3 additions & 3 deletions tests/test_process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .constants import version
from .fixtures import elasticsearch


Expand All @@ -11,5 +10,6 @@ def test_process_is_running_as_the_correct_user(elasticsearch):


def test_process_is_running_the_correct_version(elasticsearch):
version_string = version.replace('-SNAPSHOT', '')
assert elasticsearch.get_root_page()['version']['number'] == version_string
running_version = elasticsearch.get_root_page()['version']['number']
correct_version = elasticsearch.version_number
assert running_version == correct_version

0 comments on commit a625c8b

Please sign in to comment.