chore: add CI workflow - #41
Merged
Merged
Conversation
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>
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 placeholderGOOGLE_API_KEYset so the provider mounts.Fixes folded in (found during clean-room verification)
test_usage_model_dump_proves_this_was_never_a_serialization_bugfailed withDecimal is not JSON serializable. Root cause: the pinned dev flooramplifier-core>=1.0.10resolved toamplifier-core==1.0.10/pydantic-core==2.41.4, whereUsage'sfield_serializer(when_used="always")forcost_usddoesn't fire on plainmodel_dump(). Bumped the floor toamplifier-core>=1.6.0(matching provider-openai/anthropic), which resolvesamplifier-core==1.6.1/pydantic-core==2.46.5— serializer fires correctly there.TestFallbackModelsVision(2 tests) asserted on a hardcoded 5-model fallback list that was intentionally removed on 2026-04-22 (seelist_models()'s own docstring) in favor of hard-failing without live credentials, matching anthropic/openai. These tests could never pass again as written. Replaced withTestNoCredentialsHardFails, asserting the current correct behavior:list_models()raisesLLMErrorwithout credentials.amplifier-corebehavioral testtest_list_models_returns_list, and this repo's owntest_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.liveand deselected via-m "not live".Verification
In a genuinely clean environment (all ambient provider API keys unset, only the CI placeholder key set):
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.