Skip to content

chore: add CI workflow to run offline unit tests #14

Description

@pinecone-groundskeeper

Problem

pinecone-io/bird-search-example has no .github/workflows/ directory at all, so nothing runs the test suite on push or PR. That matters here specifically because tests/test_query.py is a real, offline-runnable suite (10 tests, mocks pinecone.Pinecone and google.genai.Client at import time — no network or API keys needed) that currently passes cleanly but has nothing exercising it before merge. A future dependency bump (pinecone, google-genai) or a code change to query.py's request-shape assumptions could silently break it.

tests/conftest.py's own docstring says the offline suite is meant to "stay green" automatically on a keyless machine — implying CI was assumed but never wired up.

Solution

Added .github/workflows/ci.yml:

  • Triggers on push and pull_request.
  • Installs from requirements.txt plus pytest.
  • Runs pytest tests/test_query.py only — not tests/test_live.py, which is explicitly documented in conftest.py as excluded from CI (it hits the real Pinecone/Gemini index and needs live credentials this repo doesn't provision in CI).
  • Sets an explicit least-privilege permissions: { contents: read } block.

Verification

Installed dependencies in a clean environment and ran the target command directly:

$ pytest tests/test_query.py -v
...
10 passed in 0.55s

Also confirmed the workflow actually catches regressions: temporarily broke one assertion (top_k == 7top_k == 999) and reran — pytest exited non-zero with a clear failure (assert 7 == 999), then restored the original file (working tree is clean, no test file changes are part of this PR — see git status / the diff, which touches only the new workflow file).

Follow-ups

Out of scope for this PR (per the issue), and not filed as new issues since they're already tracked separately in the backlog: fixing pytest tests/ (bare, no path) failing on collection when run without API keys is issue #12, and adding lint/coverage/release pipelines was explicitly excluded from this issue's scope.

Closes #11

Generated by GitHub Maintenance Fixer · sonnet50 · 102.2 AIC · ⌖ 17.2 AIC · ⊞ 8.1K ·


Note

This was originally intended as a pull request, but the git push operation failed.

Original error: The process '/usr/bin/git' failed with exit code 128

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 30638637180 -n agent -D /tmp/agent-30638637180

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-30638637180/aw-pinecone-io-bird-search-example-agent-maintenance-issue-11.bundle refs/heads/agent/maintenance/issue-11:refs/bundles/create-pr-agent-maintenance-issue-11-72bccebe8c42e076-41feb514
git update-ref refs/heads/agent/maintenance/issue-11-72bccebe8c42e076 refs/bundles/create-pr-agent-maintenance-issue-11-72bccebe8c42e076-41feb514
git checkout agent/maintenance/issue-11-72bccebe8c42e076
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-agent-maintenance-issue-11-72bccebe8c42e076-41feb514

# Push the branch to origin
git push origin agent/maintenance/issue-11-72bccebe8c42e076

# Create the pull request
gh pr create --title 'chore: add CI workflow to run offline unit tests' --base main --head agent/maintenance/issue-11-72bccebe8c42e076 --repo pinecone-io/bird-search-example

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:maintenanceOpened/maintained by the maintenance agent; it recognizes its own work by this labelagentic-workflows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions