def perform_ci_test(env_id, render, manual_control, performance, save_obs): print("running game {}".format(env_id)) env_module = all_environments[env_id] _env = env_module.env() error_collected = [] try: api_test.api_test(_env, render=render, verbose_progress=True) except Exception as e: error_collected.append("API Test: " + str(e)) seed_test(env_module.env) # error_test(env_module.env()) if save_obs: test_save_obs(_env) if render: try: render_test(_env) except Exception as e: error_collected.append("Render Test:" + str(e)) if manual_control and env_id in manual_environments: try: manual_control_fn = env_module.manual_control test_manual_control.test_manual_control(manual_control_fn) except Exception as e: error_collected.append("Manual Control: " + str(e)) if performance: _env = env_module.env() performance_benchmark.performance_benchmark(_env) return error_collected
def test_module(env_module): _env = env_module.env() api_test.api_test(_env) seed_test(env_module.env) # pickle test env2 = pickle.loads(pickle.dumps(_env)) api_test.api_test(env2)
def test_module(name, env_module): _env = env_module.env() api_test.api_test(_env) if "classic/" not in name: parallel_play_test(env_module.parallel_env()) # seed_test(env_module.env, 20) render_test(_env) _env.close()
def test_module(name, env_module): _env = env_module.env() api_test.api_test(_env) if "classic/" not in name: parallel_play_test(env_module.parallel_env()) seed_test(env_module.env) # pickle test env2 = pickle.loads(pickle.dumps(_env)) api_test.api_test(env2)
def test_module(name, env_module): _env = env_module.env() api_test.api_test(_env) if "classic/" not in name: parallel_play_test(env_module.parallel_env()) # seed_test(env_module.env, 20) if "prospector" not in name: seed_test(env_module.env, 50) max_cycles_test(env_module, name)
def test_pettinzoo_pad_action_space(): _env = simple_world_comm_v2.env() wrapped_env = pad_action_space_v0(_env) api_test.api_test(wrapped_env) seed_test.seed_test( lambda: sticky_actions_v0(simple_world_comm_v2.env(), 0.5))
def test_pettinzoo_frame_stack(): _env = simple_push_v2.env() wrapped_env = frame_stack_v1(_env) api_test.api_test(wrapped_env)
def test_pettingzoo_aec_api(env): api_test.api_test(env)
def test_module(env_constr, kwargs): _env = env_constr(**kwargs) print(kwargs) api_test.api_test(_env)
from .error_tests import error_test from .seed_test import seed_test from .save_obs_test import test_save_obs render = sys.argv[2] == 'True' manual_control = sys.argv[3] == 'True' bombardment = sys.argv[4] == 'True' performance = sys.argv[5] == 'True' save_obs = sys.argv[6] == 'True' env_id = sys.argv[1] if env_id in all_environments: print("running game {}".format(env_id)) env_module = all_environments[env_id] _env = env_module.raw_env() api_test.api_test(_env, render=render, verbose_progress=True) seed_test(env_module.env) # error_test(env_module.env()) if save_obs: test_save_obs(_env) if render: test_render(_env) if manual_control: manual_control_fn = getattr(env_module, "manual_control", None) if manual_control_fn is not None: test_manual_control.test_manual_control(manual_control_fn)
def test_api(self): api_test.api_test(env(**self.full_config))
def test_module(env_constr, kwargs): _env = env_constr() api_test.api_test(_env)
def test_module(env_module): _env = env_module.env() api_test.api_test(_env) seed_test(env_module.env)