Skip to content

chore: add CI workflow - #41

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
chore/add-ci
Aug 28, 2026
Merged

chore: add CI workflow#41
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
chore/add-ci

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

Why

Cross-repo audit of the amplifier-module-provider family found 9 of 11 repos have no CI workflow at all. This is one of the 9 (part of work item 57h).

What

Adds .github/workflows/ci.yml: pytest on ubuntu-latest across Python 3.11 and 3.12, 10-minute timeout, uv sync --all-extras --dev + uv run pytest -q -m "not live", with a placeholder GOOGLE_API_KEY set so the provider mounts.

Fixes folded in (found during clean-room verification)

  1. test_usage_model_dump_proves_this_was_never_a_serialization_bug failed with Decimal is not JSON serializable. Root cause: the pinned dev floor amplifier-core>=1.0.10 resolved to amplifier-core==1.0.10 / pydantic-core==2.41.4, where Usage's field_serializer(when_used="always") for cost_usd doesn't fire on plain model_dump(). Bumped the floor to amplifier-core>=1.6.0 (matching provider-openai/anthropic), which resolves amplifier-core==1.6.1 / pydantic-core==2.46.5 — serializer fires correctly there.
  2. TestFallbackModelsVision (2 tests) asserted on a hardcoded 5-model fallback list that was intentionally removed on 2026-04-22 (see list_models()'s own docstring) in favor of hard-failing without live credentials, matching anthropic/openai. These tests could never pass again as written. Replaced with TestNoCredentialsHardFails, asserting the current correct behavior: list_models() raises LLMError without credentials.
  3. The inherited amplifier-core behavioral test test_list_models_returns_list, and this repo's own test_image_vision_integration_with_real_api, both make real network calls to Google's API and cannot pass in CI without genuine credentials. Marked @pytest.mark.live and deselected via -m "not live".

Verification

In a genuinely clean environment (all ambient provider API keys unset, only the CI placeholder key set):

uv run pytest -q -m "not live"
-> 204 passed, 2 deselected

Note: my first pass at "clean-room" verification for this rollout was itself contaminated by ambient real API keys present in my shell (GOOGLE_API_KEY, OPENAI_API_KEY, etc. were already exported). Re-verified with those explicitly unset to match what a real CI runner (no repo secrets) actually sees — that's what surfaced fix #3 above.

Merge note

This PR is self-authored / admin-merged at user direction as part of the family-wide CI rollout (work item 57h). The new CI workflow will be verified running green on this PR itself before merge.

This module had no CI at all. Also fixes 3 pre-existing test failures
and a stale amplifier-core dependency floor discovered during
clean-room verification, plus 2 real-network tests that only surface
in a genuinely clean environment (no ambient API keys):

1. tests/test_thinking_cost_and_unpriced_model.py::
   test_usage_model_dump_proves_this_was_never_a_serialization_bug
   failed with 'Decimal is not JSON serializable'. Root cause: the
   pinned dev-dependency floor (amplifier-core>=1.0.10) resolved to
   amplifier-core 1.0.10 / pydantic-core 2.41.4, where Usage's
   field_serializer(when_used="always") for cost_usd does not fire on
   plain model_dump(). Bumped the floor to amplifier-core>=1.6.0
   (matching provider-openai/anthropic), resolving amplifier-core
   1.6.1 / pydantic-core 2.46.5, where the serializer fires correctly.

2. tests/test_pricing_and_vision.py::TestFallbackModelsVision (2 tests)
   asserted on a hardcoded 5-model fallback list that was intentionally
   removed 2026-04-22 (see list_models()'s own docstring) in favor of
   hard-failing without live credentials, matching anthropic/openai.
   These tests could never pass again. Replaced with a single test
   (TestNoCredentialsHardFails) asserting the current, correct
   behavior: list_models() raises LLMError without credentials.

3. The inherited amplifier-core behavioral test
   test_list_models_returns_list, and this repo's own
   test_image_vision_integration_with_real_api, both make real network
   calls and cannot pass in CI without genuine Gemini credentials.
   Marked @pytest.mark.live and deselected via `-m "not live"`. CI
   sets a placeholder GOOGLE_API_KEY so mount() succeeds for every
   other behavioral/structural test (mount() only checks presence, not
   validity).

Verified in a genuinely clean environment (all ambient provider keys
unset, only the CI placeholder key set):
uv run pytest -q -m "not live" -> 204 passed, 2 deselected.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach

Copy link
Copy Markdown
Collaborator Author

Self-authored / admin-merging at user direction as part of the family-wide CI rollout (work item 57h).

CI now runs green on this PR: pytest (py3.11) and pytest (py3.12) both pass (204 passed, 2 deselected live tests requiring real Gemini credentials). Merging.

@bkrabach
Brian Krabach (bkrabach) merged commit 1c70649 into main Aug 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants