You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 == 7 → top_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.
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
Problem
pinecone-io/bird-search-examplehas no.github/workflows/directory at all, so nothing runs the test suite on push or PR. That matters here specifically becausetests/test_query.pyis a real, offline-runnable suite (10 tests, mockspinecone.Pineconeandgoogle.genai.Clientat 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 toquery.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:pushandpull_request.requirements.txtpluspytest.pytest tests/test_query.pyonly — nottests/test_live.py, which is explicitly documented inconftest.pyas excluded from CI (it hits the real Pinecone/Gemini index and needs live credentials this repo doesn't provision in CI).permissions: { contents: read }block.Verification
Installed dependencies in a clean environment and ran the target command directly:
Also confirmed the workflow actually catches regressions: temporarily broke one assertion (
top_k == 7→top_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 — seegit 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
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
agentartifact in the workflow run linked above.To create a pull request with the changes: