mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
tests: print logs on failure + fix -cp param (#327)
* tests: pring logs on failure * fix import * added job to circleci * fix functional * removed debug job
This commit is contained in:
@@ -18,6 +18,7 @@ import time
|
|||||||
import pytest
|
import pytest
|
||||||
import rl_coach.tests.utils.args_utils as a_utils
|
import rl_coach.tests.utils.args_utils as a_utils
|
||||||
import rl_coach.tests.utils.presets_utils as p_utils
|
import rl_coach.tests.utils.presets_utils as p_utils
|
||||||
|
from rl_coach.logger import screen
|
||||||
from rl_coach.tests.utils.definitions import Definitions as Def
|
from rl_coach.tests.utils.definitions import Definitions as Def
|
||||||
|
|
||||||
|
|
||||||
@@ -59,6 +60,8 @@ def test_preset_args(preset_args, flag, clres, start_time=time.time(),
|
|||||||
except AssertionError:
|
except AssertionError:
|
||||||
# close process once get assert false
|
# close process once get assert false
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
# if test failed - print logs
|
||||||
|
screen.error(open(clres.stdout.name).read(), crash=False)
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|||||||
@@ -385,23 +385,16 @@ def validate_arg_result(flag, p_valid_params, clres=None, process=None,
|
|||||||
csv = pd.read_csv(csv_path[0])
|
csv = pd.read_csv(csv_path[0])
|
||||||
|
|
||||||
# check heat-up value
|
# check heat-up value
|
||||||
results = []
|
while csv["In Heatup"].values[-1] == 1:
|
||||||
if csv["In Heatup"].values[-1] == 0:
|
csv = pd.read_csv(csv_path[0])
|
||||||
results.append(csv["Total steps"].values[-1])
|
time.sleep(1)
|
||||||
else:
|
|
||||||
while csv["In Heatup"].values[-1] == 1:
|
|
||||||
csv = pd.read_csv(csv_path[0])
|
|
||||||
last_step = csv["Total steps"].values
|
|
||||||
results.append(last_step[-1])
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
# get the first value after heat-up
|
csv.columns = [column.replace(" ", "_") for column in csv.columns]
|
||||||
time.sleep(3)
|
results = csv.query("In_Heatup == 1")
|
||||||
results.append(csv["Total steps"].values[-1])
|
last_val_in_heatup = results.Total_steps.values[-1]
|
||||||
|
assert int(last_val_in_heatup) >= Def.Consts.num_hs, \
|
||||||
assert int(results[-1]) >= Def.Consts.num_hs, \
|
|
||||||
Def.Consts.ASSERT_MSG.format("bigger than " +
|
Def.Consts.ASSERT_MSG.format("bigger than " +
|
||||||
str(Def.Consts.num_hs), results[-1])
|
str(Def.Consts.num_hs), last_val_in_heatup)
|
||||||
|
|
||||||
elif flag[0] == "-f" or flag[0] == "--framework":
|
elif flag[0] == "-f" or flag[0] == "--framework":
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user