tests/functional/configuration/test_all_options.py
def check_env_var_config(self, tmp_path, monkeypatch):
        """Check that env vars overrides global configuration"""
        assert not orion.core.config.evc.manual_resolution
        assert not orion.core.config.evc.ignore_code_changes
        assert not orion.core.config.evc.algorithm_change
        assert orion.core.config.evc.non_monitored_arguments == [
            "test",
            "two",
            "others",
        ]
        assert orion.core.config.evc.code_change_type == "unsure"
        assert orion.core.config.evc.cli_change_type == "unsure"
        assert orion.core.config.evc.config_change_type == "unsure"
        assert not orion.core.config.evc.orion_version_change

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

        # TODO: Anything to test still???
        command = self._check_cli_change(name, command, version=1, change_type="unsure")
        command = self._check_non_monitored_arguments(
            name, command, version=2, non_monitored_arguments=["test", "two", "others"]
        )
        self._check_script_config_change(
            tmp_path, name, command, version=2, change_type="unsure"
        )

        self._check_code_change(
            monkeypatch,
            name,
            command,
            version=3,
            mock_ignore_code_changes=None,
            ignore_code_changes=bool(self.env_vars["ORION_EVC_IGNORE_CODE_CHANGES"]),
            change_type=self.env_vars["ORION_EVC_CODE_CHANGE"],
        )
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):
        assert not orion.core.config.evc.manual_resolution
        assert not orion.core.config.evc.ignore_code_changes
        assert not orion.core.config.evc.algorithm_change
        assert orion.core.config.evc.non_monitored_arguments == [
            "test",
            "two",
            "others",
        ]
        assert orion.core.config.evc.code_change_type == "unsure"
        assert orion.core.config.evc.cli_change_type == "unsure"
        assert orion.core.config.evc.config_change_type == "unsure"
        assert not orion.core.config.evc.orion_version_change
        name = "env-var-test"
        command = (
            f"hunt --worker-max-trials 0 -n {name} python {script} -x~uniform(0,1)"
        )
        assert orion.core.cli.main(command.split(" ")) == 0
        command = self._check_cli_change(name, command, version=1, change_type="unsure")
        command = self._check_non_monitored_arguments(
            name, command, version=2, non_monitored_arguments=["test", "two", "others"]
        )
        self._check_script_config_change(
            tmp_path, name, command, version=2, change_type="unsure"
        )
        self._check_code_change(
            monkeypatch,
            name,
            command,
            version=3,
            mock_ignore_code_changes=None,
            ignore_code_changes=bool(self.env_vars["ORION_EVC_IGNORE_CODE_CHANGES"]),
            change_type=self.env_vars["ORION_EVC_CODE_CHANGE"],
        )
def check_env_var_config ( self , tmp_path , monkeypatch ) : assert not orion . core . config . evc . manual_resolution assert not orion . core . config . evc . ignore_code_changes assert not orion . core . config . evc . algorithm_change assert orion . core . config . evc . non_monitored_arguments == [ "test" , "two" , "others" , ] assert orion . core . config . evc . code_change_type == "unsure" assert orion . core . config . evc . cli_change_type == "unsure" assert orion . core . config . evc . config_change_type == "unsure" assert not orion . core . config . evc . orion_version_change name = "env-var-test" command = ( f"hunt --worker-max-trials 0 -n {name} python {script} -x~uniform(0,1)" ) assert orion . core . cli . main ( command . split ( " " ) ) == 0 command = self . _check_cli_change ( name , command , version = 1 , change_type = "unsure" ) command = self . _check_non_monitored_arguments ( name , command , version = 2 , non_monitored_arguments = [ "test" , "two" , "others" ] ) self . _check_script_config_change ( tmp_path , name , command , version = 2 , change_type = "unsure" ) self . _check_code_change ( monkeypatch , name , command , version = 3 , mock_ignore_code_changes = None , ignore_code_changes = bool ( self . env_vars [ "ORION_EVC_IGNORE_CODE_CHANGES" ] ) , change_type = self . env_vars [ "ORION_EVC_CODE_CHANGE" ] , )
Check that env vars overrides global configuration
Check that env vars overrides global configuration
"""Check that env vars overrides global configuration""" # TODO: Anything to test still???
self
tmp_path
monkeypatch