Skip to content

Commit

Permalink
BI-4981: use a connector whitelist in RQE apps in tests (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCPN authored Oct 10, 2023
1 parent afe8828 commit 35a63b2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/dl_api_lib_testing/dl_api_lib_testing/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ class RQEConfigurationMaker:

@contextlib.contextmanager
def sync_rqe_netloc_subprocess_cm(self) -> Generator[RQEBaseURL, None, None]:
whitelist = self.bi_test_config.core_test_config.get_core_library_config().core_connector_ep_names
env = dict(
EXT_QUERY_EXECUTER_SECRET_KEY=self.bi_test_config.ext_query_executer_secret_key,
DEV_LOGGING="1",
)
if whitelist:
env["CORE_CONNECTOR_WHITELIST"] = ",".join(whitelist)

with WSGIRunner(
module="dl_core.bin.query_executor_sync",
callable="app",
ping_path="/ping",
env=dict(
EXT_QUERY_EXECUTER_SECRET_KEY=self.bi_test_config.ext_query_executer_secret_key,
DEV_LOGGING="1",
),
env=env,
) as runner:
yield RQEBaseURL( # type: ignore # TODO: fix compatibility of models using `s_attrib` with mypy
host=runner.bind_addr,
Expand Down

0 comments on commit 35a63b2

Please sign in to comment.