Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/build_cloud_run_env_sync_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def _should_add_local_src(candidate: Path) -> bool:
"LONGBRIDGE_MARKET_TIMEZONE",
"LONGBRIDGE_SYMBOL_SUFFIX",
"LONGBRIDGE_TRADING_CURRENCY",
# This value is scoped by the GitHub deployment Environment. Do not
# silently remove a configured plugin mount merely because a
# per-service target omits a duplicate copy of it.
"LONGBRIDGE_STRATEGY_PLUGIN_MOUNTS_JSON",
}
)
REQUIRED_ENV = (
Expand Down
12 changes: 12 additions & 0 deletions tests/test_build_cloud_run_env_sync_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def test_build_cloud_run_env_sync_plan_supports_per_service_targets():
**os.environ,
"CLOUD_RUN_SERVICE_TARGETS_JSON": json.dumps(payload),
"LONGBRIDGE_FEATURE_SNAPSHOT_PATH": "gs://stale-paper/snapshot.csv",
"LONGBRIDGE_STRATEGY_PLUGIN_MOUNTS_JSON": (
'{"strategy_plugins":[{"strategy":"tqqq_growth_income",'
'"plugin":"market_regime_control","enabled":true}]}'
),
}

result = subprocess.run(
Expand All @@ -228,6 +232,10 @@ def test_build_cloud_run_env_sync_plan_supports_per_service_targets():
assert hk_verify["env"]["STRATEGY_PROFILE"] == "tqqq_growth_income"
assert hk_verify["env"]["LONGBRIDGE_MARKET"] == "HK"
assert hk_verify["env"]["LONGBRIDGE_TRADING_CURRENCY"] == "HKD"
assert hk_verify["env"]["LONGBRIDGE_STRATEGY_PLUGIN_MOUNTS_JSON"] == (
'{"strategy_plugins":[{"strategy":"tqqq_growth_income",'
'"plugin":"market_regime_control","enabled":true}]}'
)
assert hk_verify["scheduler"] == {
"timezone": "Asia/Hong_Kong",
"main_time": "10 16",
Expand All @@ -251,6 +259,10 @@ def test_build_cloud_run_env_sync_plan_supports_per_service_targets():
live_mega["env"]["LONGBRIDGE_FEATURE_SNAPSHOT_MANIFEST_PATH"]
== "gs://runtime/mega/snapshot.csv.manifest.json"
)
assert live_mega["env"]["LONGBRIDGE_STRATEGY_PLUGIN_MOUNTS_JSON"] == (
'{"strategy_plugins":[{"strategy":"tqqq_growth_income",'
'"plugin":"market_regime_control","enabled":true}]}'
)


def test_current_service_uses_environment_runtime_enabled_state():
Expand Down