提交 d6a1eaca 编写于 作者: N niuyazhe

test(nyz): polish unittest and fix remove ckpt dir bug

上级 13450e65
......@@ -7,9 +7,11 @@ omit =
ding/utils/k8s_helper.py
ding/config/utils.py
ding/entry/tests/test_serial_entry_algo.py
ding/entry/tests/test_serial_entry.py
ding/entry/dist_entry.py
ding/entry/cli.py
ding/entry/predefined_config.py
ding/hpc_rl/*
ding/worker/collector/tests/speed_test/*
ding/envs/env_wrappers/env_wrappers.py
ding/rl_utils/tests/test_ppg.py
......@@ -354,8 +354,6 @@ def test_cql():
serial_pipeline_offline(config, seed=0)
except Exception:
assert False, "pipeline fail"
finally:
os.popen('rm -rf default_experiment')
@pytest.mark.unittest
......@@ -364,10 +362,12 @@ def test_d4pg():
config[0].policy.learn.update_per_collect = 1
try:
serial_pipeline(config, seed=0, max_iterations=1)
except Exception:
except Exception as e:
assert False, "pipeline fail"
print(repr(e))
@pytest.mark.unittest
def test_discrete_cql():
# train expert
config = [deepcopy(cartpole_qrdqn_config), deepcopy(cartpole_qrdqn_create_config)]
......
......@@ -395,7 +395,18 @@ def test_discrete_cql():
f.write("27. discrete cql\n")
@pytest.mark.algotest
# @pytest.mark.algotest
def test_wqmix():
config = [deepcopy(cooperative_navigation_wqmix_config), deepcopy(cooperative_navigation_wqmix_create_config)]
try:
serial_pipeline(config, seed=0)
except Exception:
assert False, "pipeline fail"
with open("./algo_record.log", "a+") as f:
f.write("28. wqmix\n")
# @pytest.mark.algotest
def test_running_on_orchestrator():
from kubernetes import config, client, dynamic
cluster_name = 'test-k8s-launcher'
......@@ -438,17 +449,6 @@ def test_running_on_orchestrator():
launcher.delete_cluster()
# @pytest.mark.algotest
def test_wqmix():
config = [deepcopy(cooperative_navigation_wqmix_config), deepcopy(cooperative_navigation_wqmix_create_config)]
try:
serial_pipeline(config, seed=0)
except Exception:
assert False, "pipeline fail"
with open("./algo_record.log", "a+") as f:
f.write("27. wqmix\n")
def create_object_from_config(config_path: str, namespace: str = 'default'):
args = ['kubectl', 'apply', '-n', namespace, '-f', config_path]
proc = subprocess.Popen(args, stderr=subprocess.PIPE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册