Files
085506e3f3 Feat/connectors gateway install (#14)
* feat(connectors): add gateway connectors and drop baidu-netdisk/figma

Expand the catalog with QQ Music, Fliggy, Baidu Map, Ctrip Wendao, Meituan Travel, and Yuandian; migrate Tencent News to API key; unify gateway credential probes; remove Baidu Netdisk/Figma OAuth paths.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(install): ship Playwright by default and harden install scripts

Make browser tooling a core dependency, drop obsolete optional extras, and improve glibc/Playwright system-deps handling across install.sh/ps1/bat.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(desktop): install build deps before Python packages on Linux

Add a build-deps-only path so remote desktop setup can compile extension wheels when system headers are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dashboard): cache update-status checks in localStorage

Deduplicate concurrent PyPI probes across mounts and persist the last known update status with a short TTL.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(live): add OSS probes, secret helpers, and CI live job

Centralize require_env skipping, document live credentials in .env.example, and wire a secrets-gated live-tests workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(tests): rename chat WS integration test and drop dead cases

Align the chat transport test name with WebSocket usage and remove a skipped bootstrap harness test.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ci): unblock typecheck, CodeQL, and drifted live tests

Align mypy with requires-python 3.12 so numpy stubs parse; clarify Fliggy
SHA-256 use for request signing; update live expert/backend assertions
to the lazy Expert catalog and DEFAULT_BACKEND_SPEC with root_dir.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ci): news Skill-Request-Id, workspace live reads, CodeQL FP

Add Tencent News CLI headers required by error 4010; assert expert
seeds via agent.workspace instead of host-rooted backend paths; ignore
Fliggy signing digests in CodeQL (protocol SHA-256, not password KDF).

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(tests): allow newline-only __init__.py in expert live checks

Office-automation skill packages ship empty package markers; strip()-based
emptiness assertions should not treat those as copy failures.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(tests): compare expert seeds via adownload_bytes

Harness aread_text replaces empty/whitespace file bodies with a system
reminder, which broke live office-automation __init__.py checks.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 19:25:51 +08:00

35 lines
1.1 KiB
Python

"""Helpers for live tests that need real credentials.
The repo-root ``.env`` is loaded by ``tests/live/conftest.py`` via python-dotenv,
so these helpers read from ``os.environ`` directly — the same code path used both
locally (``.env``) and in CI (GitHub Secrets mapped to env vars).
Missing credentials should never make CI red: call :func:`require_env` inside a
test and it will ``pytest.skip`` gracefully.
"""
from __future__ import annotations
import os
import pytest
def optional_env(name: str, default: str | None = None) -> str | None:
"""Return the env var value, or ``default`` when unset/empty."""
value = os.environ.get(name, "")
return value if value else default
def require_env(name: str) -> str:
"""Return the env var value, or skip the test when missing.
Use inside a test (or a fixture) so that absent secrets cause a skip
rather than a failure. This keeps CI green when credentials are not
configured while still running the real integration when they are.
"""
value = os.environ.get(name, "").strip()
if not value:
pytest.skip(f"set {name} to run this live test")
return value