don't throw in the version check if eden is not installed

Summary:
in our sandcastle environment, eden is not currently
installed and the tests that look at the version are throwing
an error when the rpm query fails.

Don't do that!

Reviewed By: simpkins

Differential Revision: D6853305

fbshipit-source-id: d17cb1fb0253ef5ae5000695b6ec5bcda4a6a448
This commit is contained in:
Wez Furlong 2018-01-30 21:40:55 -08:00 committed by Facebook Github Bot
parent d6adcfc058
commit f82026e4fb
2 changed files with 9 additions and 4 deletions

View File

@ -13,10 +13,13 @@ from . import config as config_mod
def get_installed_eden_rpm_version() -> str:
return subprocess.check_output(
['rpm', '-q', 'fb-eden', '--queryformat', '%{version}-%{release}']
).decode('utf-8')
proc = subprocess.run(['rpm', '-q', 'fb-eden', '--queryformat',
'%{version}-%{release}'],
stdout=subprocess.PIPE,
encoding='utf-8')
if proc.returncode != 0:
return "<Not Installed>"
return proc.stdout
# returns (runing_version, release) tuple
def get_running_eden_version_parts(

View File

@ -40,6 +40,8 @@ class BasicTest:
output = self.eden.run_cmd('version', cwd=self.mount)
first_line = output.split('\n')[0]
self.assertTrue(first_line.startswith('Installed: '))
if 'Not Installed' in first_line:
self.skipTest("eden is not installed")
parts = first_line[11:].split('-')
self.assertEqual(len(parts[0]), 8)
self.assertEqual(len(parts[1]), 6)