Skip to content

Phase 5 scaffold: real-API integration tests + CI workflow#7

Merged
OmkarRayAI merged 1 commit into
mainfrom
feat/phase5-scaffold
Jun 4, 2026
Merged

Phase 5 scaffold: real-API integration tests + CI workflow#7
OmkarRayAI merged 1 commit into
mainfrom
feat/phase5-scaffold

Conversation

@OmkarRayAI

Copy link
Copy Markdown
Owner

Context

Phase 5 (real-API verification) was the only remaining pending item from the original plan, blocked on user-provided OpenAI/Anthropic keys. This PR ships the scaffold so the moment a key lands, every alpha adapter gets verified against real endpoints — no further code work needed.

What

tests/integration/ — three test files, all gated on env vars:

  • test_openai_real.py — sync non-streaming, sync streaming (with stream_options.include_usage), async non-streaming. Asserts provider, model, prompt_chars, input_tokens, output_tokens, cost_usd, latency_ms, retry_count, plus token events on the streaming span.
  • test_anthropic_real.py — same three modes against claude-haiku-4-5.
  • conftest.pyopenai_key / anthropic_key fixtures that skip cleanly when the env var is absent.

Each test uses the cheapest model and max_tokens=10. A full pass costs a fraction of a cent.

.github/workflows/ci-real-api.yml — separate workflow:

  • Triggers: workflow_dispatch + weekly cron (Tue 14:00 UTC)
  • Two jobs (openai, anthropic) read their keys from repo secrets
  • If the secret isn't set, the job exits 0 cleanly (no false red)
  • concurrency.cancel-in-progress on the ref so a flaky upstream doesn't queue retries

README.md — new "Tests" section explaining the three invocations:

pytest -q tests/                                    # default (free, offline)
DATABASE_URL=... pytest -q tests/                   # + asyncpg path
OPENAI_API_KEY=... pytest tests/integration/test_openai_real.py    # real API

Verified locally

pytest -q tests/ → 88 passed, 12 skipped (6 new integration tests skip cleanly without keys; existing Postgres skips unchanged). No false failures.

To activate real-API verification

Settings → Secrets → Actions → New repository secret
  OPENAI_API_KEY=sk-...
  ANTHROPIC_API_KEY=sk-ant-...

Then trigger via the Actions tab → "ci-real-api" → "Run workflow", or wait for the weekly cron.

Test plan

  • Default suite stays green on this PR's CI run (verifies the integration files don't break collection)
  • Once secrets are added, manually dispatch ci-real-api and confirm both jobs go green
  • After verification: update README's Integrations table — move CrewAI/ADK/Agno/OpenAI/Anthropic from "alpha" to "verified" labels (separate doc-only PR)

🤖 Generated with Claude Code

Phase 5 was blocked on user-provided keys. Ship the scaffold so the
moment a key lands in the env (locally or as a CI secret), every alpha
adapter gets verified against real endpoints with no further code work.

tests/integration/
- conftest.py: openai_key / anthropic_key fixtures that skip cleanly
  when the env var is absent (so default `pytest tests/` stays free
  and offline)
- test_openai_real.py: sync non-streaming, sync streaming (with
  stream_options.include_usage), async non-streaming. Asserts
  provider, model prefix, prompt_chars, input/output_tokens, cost_usd,
  latency_ms, retry_count, plus token events on the streaming span.
- test_anthropic_real.py: same three modes against claude-haiku-4-5.

Each test uses the cheapest available model and max_tokens=10. A full
pass costs a fraction of a cent.

.github/workflows/ci-real-api.yml
- Separate workflow gated on workflow_dispatch + weekly cron (Tue 14:00 UTC)
- Two jobs: openai, anthropic — each reads its key from a repo secret
- If the secret isn't set, the job exits 0 cleanly (no false red)
- concurrency cancel-in-progress on the ref so a flaky upstream
  doesn't queue retries

pyproject.toml
- Register the `integration` pytest marker so the suite stops warning
  about unrecognized markers when the integration files are collected

README.md
- New "Tests" section with the three commands (default / Postgres /
  real-API), positioned just before Pricing

Verified locally: `pytest -q tests/` exits 0 with 88 passed + 12
skipped (the 6 integration tests now skip cleanly without keys; the
existing skip count for Postgres unchanged).

To activate the real-API path:
  Settings → Secrets → Actions → New repository secret
    OPENAI_API_KEY, ANTHROPIC_API_KEY
  Then trigger via the Actions tab → "ci-real-api" → "Run workflow"
  or wait for the weekly cron.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@OmkarRayAI OmkarRayAI merged commit 4d0c571 into main Jun 4, 2026
4 checks passed
@OmkarRayAI OmkarRayAI deleted the feat/phase5-scaffold branch June 4, 2026 11:19
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.

1 participant