diff --git a/cli/administration/deploy/development/deploy/run.py b/cli/administration/deploy/development/deploy/run.py index 7e1f27c78f..aada71cb71 100644 --- a/cli/administration/deploy/development/deploy/run.py +++ b/cli/administration/deploy/development/deploy/run.py @@ -18,6 +18,7 @@ if TYPE_CHECKING: _FORWARDED_ENV_KEYS = ( "APP_ID", + "guide_host", "GH_TOKEN", "GITHUB_TOKEN", "GITHUB_REPOSITORY_OWNER", diff --git a/tests/unit/python/cli/administration/deploy/development/test_forwarded_env.py b/tests/unit/python/cli/administration/deploy/development/test_forwarded_env.py index fff5086c64..abe1b6c6e0 100644 --- a/tests/unit/python/cli/administration/deploy/development/test_forwarded_env.py +++ b/tests/unit/python/cli/administration/deploy/development/test_forwarded_env.py @@ -4,6 +4,12 @@ Ansible runs inside that container, so a variable the host exports reaches a lookup only when ``_run_deploy`` forwards it explicitly. ``APP_ID`` is the deploy workflow's name for the row's app, and :mod:`plugins.lookup.guide_role` reads it to pin the documentation replay. + +``guide_host`` names the app a documentation row rides along with, and +``web-app-docs``'s playwright environment reads it to decide whether this row +owns the language assertion. Unforwarded, the lookup is empty, the comparison +against the row's own id is true everywhere, and every passenger row pays the +two Sphinx builds the gate exists to skip. """ from __future__ import annotations @@ -51,6 +57,14 @@ class TestForwardedEnv(unittest.TestCase): def test_an_empty_app_id_is_not_forwarded(self): self.assertNotIn("APP_ID", _deploy()) + @patch.dict(os.environ, {"guide_host": "web-app-moodle"}, clear=True) + def test_the_guide_host_reaches_the_container(self): + self.assertEqual(_deploy().get("guide_host"), "web-app-moodle") + + @patch.dict(os.environ, {}, clear=True) + def test_an_unset_guide_host_is_not_invented(self): + self.assertNotIn("guide_host", _deploy()) + if __name__ == "__main__": unittest.main()