Commit graph

2 commits

Author SHA1 Message Date
Teknium
5d179b9777
fix(tests): pass base_url to 31 more AIAgent() calls across run_agent tests
Same root cause as previous commit — tests that construct AIAgent()
without base_url rely on provider-resolver fallback state that doesn't
exist in hermetic CI / shard-split runs. Previously hidden because
other tests in the same xdist worker happened to prime module state.

Covered by the previous fix: calls that passed api_key but not base_url.
This covers calls that pass NEITHER (model=... only) — test_streaming.py
especially (24 call sites). Plus test_860_dedup, test_compression_
persistence, test_create_openai_client_*, test_provider_parity.

One call site (test_none_base_url_passed_as_none) remains explicitly
unmodified — it asserts None/empty base_url behavior, so adding base_url
would defeat the test's intent.

Validation:
- tests/run_agent/: 760 passed, 0 failed (local)
- Matrix shard 3 subset: 3098 passed, 0 failed, 1m49s (local)
2026-04-17 07:17:54 -07:00
Siddharth Balyan
f3006ebef9
refactor(tests): re-architect tests + fix CI failures (#5946)
* refactor: re-architect tests to mirror the codebase

* Update tests.yml

* fix: add missing tool_error imports after registry refactor

* fix(tests): replace patch.dict with monkeypatch to prevent env var leaks under xdist

patch.dict(os.environ) can leak TERMINAL_ENV across xdist workers,
causing test_code_execution tests to hit the Modal remote path.

* fix(tests): fix update_check and telegram xdist failures

- test_update_check: replace patch("hermes_cli.banner.os.getenv") with
  monkeypatch.setenv("HERMES_HOME") — banner.py no longer imports os
  directly, it uses get_hermes_home() from hermes_constants.

- test_telegram_conflict/approval_buttons: provide real exception classes
  for telegram.error mock (NetworkError, TimedOut, BadRequest) so the
  except clause in connect() doesn't fail with "catching classes that do
  not inherit from BaseException" when xdist pollutes sys.modules.

* fix(tests): accept unavailable_models kwarg in _prompt_model_selection mock
2026-04-07 17:19:07 -07:00
Renamed from tests/test_compression_persistence.py (Browse further)