1
0
mirror of https://github.com/gryf/coach.git synced 2026-03-13 04:55:47 +01:00

tests: stabling functional tests (#355)

* tests: stabling functional tests

* functional removed
This commit is contained in:
anabwan
2019-06-20 15:30:47 +03:00
committed by GitHub
parent 8e812ef82f
commit 7b5d6a3f03
2 changed files with 10 additions and 44 deletions

View File

@@ -67,42 +67,6 @@ def test_preset_args(preset_args, flag, clres, start_time=time.time(),
proc.kill()
@pytest.mark.functional_test
def test_preset_mxnet_framework(preset_for_mxnet_args, clres,
start_time=time.time(),
time_limit=Def.TimeOuts.test_time_limit):
""" Test command arguments - the test will check mxnet framework"""
flag = ['-f', 'mxnet']
p_valid_params = p_utils.validation_params(preset_for_mxnet_args)
run_cmd = [
'python3', 'rl_coach/coach.py',
'-p', '{}'.format(preset_for_mxnet_args),
'-e', '{}'.format("ExpName_" + preset_for_mxnet_args),
]
# add flags to run command
test_flag = a_utils.add_one_flag_value(flag=flag)
run_cmd.extend(test_flag)
print(str(run_cmd))
proc = subprocess.Popen(run_cmd, stdout=clres.stdout, stderr=clres.stdout)
try:
a_utils.validate_arg_result(flag=test_flag,
p_valid_params=p_valid_params, clres=clres,
process=proc, start_time=start_time,
timeout=time_limit)
except AssertionError:
# close process once get assert false
proc.kill()
assert False
proc.kill()
@pytest.mark.functional_test
def test_preset_seed(preset_args_for_seed, clres, start_time=time.time(),
time_limit=Def.TimeOuts.test_time_limit):
@@ -149,6 +113,8 @@ def test_preset_seed(preset_args_for_seed, clres, start_time=time.time(),
timeout=time_limit)
except AssertionError:
close_processes()
# if test failed - print logs
screen.error(open(clres.stdout.name).read(), crash=False)
assert False
close_processes()
@@ -194,13 +160,15 @@ def test_preset_n_and_ew(preset_args, clres, start_time=time.time(),
except AssertionError:
# close process once get assert false
proc.kill()
# if test failed - print logs
screen.error(open(clres.stdout.name).read(), crash=False)
assert False
proc.kill()
@pytest.mark.functional_test
@pytest.mark.xfail(reason="https://github.com/NervanaSystems/coach/issues/257")
@pytest.mark.skip(reason="https://github.com/NervanaSystems/coach/issues/257")
def test_preset_n_and_ew_and_onnx(preset_args, clres, start_time=time.time(),
time_limit=Def.TimeOuts.test_time_limit):
"""
@@ -259,6 +227,8 @@ def test_preset_n_and_ew_and_onnx(preset_args, clres, start_time=time.time(),
except AssertionError:
# close process once get assert false
proc.kill()
# if test failed - print logs
screen.error(open(clres.stdout.name).read(), crash=False)
assert False
proc.kill()