tests/functional/configuration/test_all_options.py
def check_env_var_config(self, tmp_path, monkeypatch):
        """Check that env vars overrides global configuration"""
        env_var_config = {
            "heartbeat": self.env_vars["ORION_HEARTBEAT"],
            "max_trials": self.env_vars["ORION_WORKER_MAX_TRIALS"],
            "max_broken": self.env_vars["ORION_WORKER_MAX_BROKEN"],
            "max_idle_time": self.env_vars["ORION_MAX_IDLE_TIME"],
            "interrupt_signal_code": self.env_vars["ORION_INTERRUPT_CODE"],
            "user_script_config": self.env_vars["ORION_USER_SCRIPT_CONFIG"],
        }

        assert orion.core.config.to_dict()["worker"] == env_var_config

        self._mock_consumer(monkeypatch)
        self._mock_producer(monkeypatch)
        self._mock_workon(monkeypatch)

        command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)"
        orion.core.cli.main(command.split(" "))

        self._check_consumer(env_var_config)
        self._check_producer(env_var_config)
        self._check_workon(env_var_config)
Check that env vars overrides global configuration
Check that env vars overrides global configuration
Check that env vars overrides global configuration
def check_env_var_config(self, tmp_path, monkeypatch):
        env_var_config = {
            "heartbeat": self.env_vars["ORION_HEARTBEAT"],
            "max_trials": self.env_vars["ORION_WORKER_MAX_TRIALS"],
            "max_broken": self.env_vars["ORION_WORKER_MAX_BROKEN"],
            "max_idle_time": self.env_vars["ORION_MAX_IDLE_TIME"],
            "interrupt_signal_code": self.env_vars["ORION_INTERRUPT_CODE"],
            "user_script_config": self.env_vars["ORION_USER_SCRIPT_CONFIG"],
        }
        assert orion.core.config.to_dict()["worker"] == env_var_config
        self._mock_consumer(monkeypatch)
        self._mock_producer(monkeypatch)
        self._mock_workon(monkeypatch)
        command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)"
        orion.core.cli.main(command.split(" "))
        self._check_consumer(env_var_config)
        self._check_producer(env_var_config)
        self._check_workon(env_var_config)
def check_env_var_config ( self , tmp_path , monkeypatch ) : env_var_config = { "heartbeat" : self . env_vars [ "ORION_HEARTBEAT" ] , "max_trials" : self . env_vars [ "ORION_WORKER_MAX_TRIALS" ] , "max_broken" : self . env_vars [ "ORION_WORKER_MAX_BROKEN" ] , "max_idle_time" : self . env_vars [ "ORION_MAX_IDLE_TIME" ] , "interrupt_signal_code" : self . env_vars [ "ORION_INTERRUPT_CODE" ] , "user_script_config" : self . env_vars [ "ORION_USER_SCRIPT_CONFIG" ] , } assert orion . core . config . to_dict ( ) [ "worker" ] == env_var_config self . _mock_consumer ( monkeypatch ) self . _mock_producer ( monkeypatch ) self . _mock_workon ( monkeypatch ) command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)" orion . core . cli . main ( command . split ( " " ) ) self . _check_consumer ( env_var_config ) self . _check_producer ( env_var_config ) self . _check_workon ( env_var_config )
Check that env vars overrides global configuration
Check that env vars overrides global configuration
"""Check that env vars overrides global configuration"""
self
tmp_path
monkeypatch