diff --git a/.coveragerc b/.coveragerc index 5ec322385a4123f28a233ee9385be9f4fe1271cb..23cc3528d7537850cc2ce74f2c5dc1c441827609 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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 diff --git a/ding/entry/tests/test_serial_entry.py b/ding/entry/tests/test_serial_entry.py index a46d6e9ae1140d8ba79c0f16ca55cdf5e410e4b6..670d48fe0683c7ebdacb914348a7797a794cf57b 100644 --- a/ding/entry/tests/test_serial_entry.py +++ b/ding/entry/tests/test_serial_entry.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)] diff --git a/ding/entry/tests/test_serial_entry_algo.py b/ding/entry/tests/test_serial_entry_algo.py index b6e079c4215ddb6f3cd9ab41440925ffe87a219d..d8fc58c611243078f49a187931463428a2434e89 100644 --- a/ding/entry/tests/test_serial_entry_algo.py +++ b/ding/entry/tests/test_serial_entry_algo.py @@ -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)