diff --git a/st2api/tests/integration/test_gunicorn_configs.py b/st2api/tests/integration/test_gunicorn_configs.py index 84fda239f5..c663aa83a7 100644 --- a/st2api/tests/integration/test_gunicorn_configs.py +++ b/st2api/tests/integration/test_gunicorn_configs.py @@ -43,6 +43,7 @@ def test_st2api_wsgi_entry_point(self): env = os.environ.copy() env["ST2_CONFIG_PATH"] = ST2_CONFIG_PATH env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) process = subprocess.Popen(cmd, env=env, shell=True, preexec_fn=os.setsid) try: self.add_process(process=process) @@ -63,6 +64,7 @@ def test_st2auth(self): env = os.environ.copy() env["ST2_CONFIG_PATH"] = ST2_CONFIG_PATH env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) process = subprocess.Popen(cmd, env=env, shell=True, preexec_fn=os.setsid) try: self.add_process(process=process) diff --git a/st2common/tests/integration/test_register_content_script.py b/st2common/tests/integration/test_register_content_script.py index 14abf12e45..c19d91c2a1 100644 --- a/st2common/tests/integration/test_register_content_script.py +++ b/st2common/tests/integration/test_register_content_script.py @@ -212,4 +212,5 @@ def test_register_recreate_virtualenvs(self): def _run_command(cmd): env = os.environ.copy() env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) return run_command(cmd=cmd, env=env) diff --git a/st2common/tests/integration/test_service_setup_log_level_filtering.py b/st2common/tests/integration/test_service_setup_log_level_filtering.py index a4f3cc90a5..03cfa1b6e5 100644 --- a/st2common/tests/integration/test_service_setup_log_level_filtering.py +++ b/st2common/tests/integration/test_service_setup_log_level_filtering.py @@ -231,6 +231,7 @@ def _start_process(config_path, env=None): cwd = os.path.abspath(cwd) env = env or os.environ.copy() env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) process = subprocess.Popen( cmd, env=env, diff --git a/st2reactor/tests/integration/test_garbage_collector.py b/st2reactor/tests/integration/test_garbage_collector.py index 630dad86de..7b8ff0dd10 100644 --- a/st2reactor/tests/integration/test_garbage_collector.py +++ b/st2reactor/tests/integration/test_garbage_collector.py @@ -277,6 +277,7 @@ def _start_garbage_collector(self): subprocess = concurrency.get_subprocess_module() env = os.environ.copy() env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) process = subprocess.Popen( CMD_INQUIRY, stdout=subprocess.PIPE, diff --git a/st2reactor/tests/integration/test_sensor_container.py b/st2reactor/tests/integration/test_sensor_container.py index 0ebae08604..e7d38eda99 100644 --- a/st2reactor/tests/integration/test_sensor_container.py +++ b/st2reactor/tests/integration/test_sensor_container.py @@ -246,6 +246,7 @@ def _start_sensor_container(self, cmd=DEFAULT_CMD): subprocess = concurrency.get_subprocess_module() env = os.environ.copy() env.update(st2tests.config.db_opts_as_env_vars()) + env.update(st2tests.config.coord_opts_as_env_vars()) print("Using command: %s" % (" ".join(cmd))) process = subprocess.Popen( cmd, diff --git a/st2tests/st2tests/config.py b/st2tests/st2tests/config.py index 22c5d62f09..9a2042be4a 100644 --- a/st2tests/st2tests/config.py +++ b/st2tests/st2tests/config.py @@ -165,6 +165,13 @@ def _override_coordinator_opts(noop=False): CONF.set_override(name="lock_timeout", override=1, group="coordination") +def coord_opts_as_env_vars() -> Dict[str, str]: + env = {} + if CONF.coordination.url is not None: + env["ST2_COORDINATION__URL"] = CONF.coordination.url + return env + + def _override_workflow_engine_opts(): cfg.CONF.set_override("retry_stop_max_msec", 200, group="workflow_engine") cfg.CONF.set_override("retry_wait_fixed_msec", 100, group="workflow_engine")