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
10 changes: 7 additions & 3 deletions .github/workflows/manual-strategy-switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ jobs:
base_url = os.environ["STRATEGY_SWITCH_CONSOLE_URL"].rstrip("/")
token = os.environ["STRATEGY_SWITCH_SYNC_TOKEN"]
if not token:
raise SystemExit("STRATEGY_SWITCH_SYNC_TOKEN is required when STRATEGY_SWITCH_CONSOLE_URL is set")
print("::warning::STRATEGY_SWITCH_SYNC_TOKEN is missing; account default sync skipped")
raise SystemExit(0)
with open(os.environ["TARGET_FILE"], encoding="utf-8") as handle:
target = json.load(handle)
runtime_target = target["runtime_target"]
Expand Down Expand Up @@ -412,7 +413,10 @@ jobs:
body = response.read().decode("utf-8")
except urllib.error.HTTPError as exc:
body = exc.read().decode("utf-8", errors="replace")
print(body, file=sys.stderr)
raise
print(f"::warning::Strategy switch account default sync failed: HTTP {exc.code}: {body[:1000]}")
raise SystemExit(0)
except Exception as exc: # noqa: BLE001
print(f"::warning::Strategy switch account default sync failed: {exc}")
raise SystemExit(0)
print(body)
PY
9 changes: 9 additions & 0 deletions tests/test_runtime_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ def test_empty_assignment_deletes_variable_instead_of_setting_empty_body(self):
self.assertNotIn("--body", assignment.shell_command())
self.assertEqual(runtime_settings.assignment_payload(assignment)["action"], "delete")

def test_manual_switch_account_default_sync_is_warning_only(self):
workflow = (ROOT / ".github" / "workflows" / "manual-strategy-switch.yml").read_text(
encoding="utf-8"
)

self.assertIn("Strategy switch account default sync failed", workflow)
self.assertIn("::warning::", workflow)
self.assertIn("raise SystemExit(0)", workflow)

def test_plugin_mount_schema_version_must_be_non_empty_string(self):
_, target = self.load_target("examples/targets/schwab/live.example.json")
target["plugin_mounts"][0]["expected_schema_version"] = ""
Expand Down