Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
def main():
    # env = simple_adversary_v1.parallel_env()
    # performance_benchmark.performance_benchmark_parallel(env)
    env = simple_adversary_v1.env()
    performance_benchmark.performance_benchmark(env)
Ejemplo n.º 3
0
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)

    if performance:
        _env = env_module.env()
        performance_benchmark.performance_benchmark(_env)

    if bombardment:
        _env = env_module.env()
        bombardment_test.bombardment_test(_env)
else:
    print(
        "Environment: '{}' not in the 'all_environments' list".format(env_id))