Skip to content

Commit

Permalink
chore: switch to testing with centralized systems - to test global state
Browse files Browse the repository at this point in the history
  • Loading branch information
sash-a committed Jul 22, 2024
1 parent 2631be6 commit 72c0c43
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import importlib

import pytest
from colorama import Fore, Style
from hydra import compose, initialize
from omegaconf import DictConfig, OmegaConf

Expand All @@ -30,9 +29,9 @@
]

discrete_envs = [
# "gigastep",
"gigastep",
"lbf",
# "matrax",
"matrax",
"rware",
"smax",
]
Expand All @@ -48,7 +47,6 @@ def _run_system(system_name: str, cfg: DictConfig) -> float:
system = importlib.import_module(f"mava.systems.{system_name}")
eval_perf = system.run_experiment(cfg)

print(f"{Fore.CYAN}{Style.BRIGHT}experiment completed{Style.RESET_ALL}")
return float(eval_perf)


Expand Down Expand Up @@ -76,9 +74,9 @@ def test_mava_system(fast_config: dict, system_path: str) -> None:

@pytest.mark.parametrize("env_name", discrete_envs)
def test_discrete_env(fast_config: dict, env_name: str) -> None:
"""Tests all discrete environments on ff_ippo."""
system_path = "ppo.ff_ippo"
system_name = "ff_ippo"
"""Tests all discrete environments on ff_mappo."""
system_path = "ppo.ff_mappo"
system_name = "ff_mappo"

with initialize(version_base=None, config_path="../mava/configs/"):
cfg = compose(config_name=f"default_{system_name}", overrides=[f"env={env_name}"])
Expand All @@ -89,9 +87,9 @@ def test_discrete_env(fast_config: dict, env_name: str) -> None:

@pytest.mark.parametrize("env_name", cnn_envs)
def test_discrete_cnn_env(fast_config: dict, env_name: str) -> None:
"""Tests all cnn environments on ff_ippo."""
system_path = "ppo.ff_ippo"
system_name = "ff_ippo"
"""Tests all cnn environments on ff_mappo."""
system_path = "ppo.ff_mappo"
system_name = "ff_mappo"

overrides = [f"env={env_name}", "network=cnn"]
with initialize(version_base=None, config_path="../mava/configs/"):
Expand All @@ -103,9 +101,9 @@ def test_discrete_cnn_env(fast_config: dict, env_name: str) -> None:

@pytest.mark.parametrize("env_name", continuous_envs)
def test_continuous_env(fast_config: dict, env_name: str) -> None:
"""Tests all continuous environments on ff_isac."""
system_path = "sac.ff_isac"
system_name = "ff_isac"
"""Tests all continuous environments on ff_masac."""
system_path = "sac.ff_masac"
system_name = "ff_masac"

with initialize(version_base=None, config_path="../mava/configs/"):
cfg = compose(config_name=f"default_{system_name}", overrides=[f"env={env_name}"])
Expand Down

0 comments on commit 72c0c43

Please sign in to comment.