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
The repository has no .github/workflows/ directory at all, so nothing runs tests/test_query.py — the 10 offline unit tests that mock pinecone.Pinecone and google.genai.Client at import time and need no network access or API keys. A dependency bump or code change could silently break query.py's request-shape assumptions with nothing catching it before merge.
Solution
Add .github/workflows/ci.yml: a single job that installs requirements.txt plus pytest, then runs pytest tests/test_query.py on every push and pull_request. It uses an explicit least-privilege permissions: contents: read block and fails the job on any non-zero pytest exit code (the default behavior of a failing shell step).
tests/test_live.py is intentionally excluded — its own docstring notes it hits the real Pinecone/Gemini index and requires live credentials this repo doesn't provision for CI.
Verification
Confirmed locally (offline, no live credentials):
$ pytest tests/test_query.py -q
.......... [100%]
10 passed in 0.28s
Note: the mocked tests patch sys.modules["pinecone"] / sys.modules["google.genai"] before query.py imports them, so only python-dotenv needs to actually be importable for query.py's module-level load_dotenv() call — the workflow still installs the full requirements.txt to match a real CI environment and catch install-time breakage too.
Follow-ups
Out of scope here, per the issue: linting/formatting enforcement, coverage thresholds, a build/release pipeline, and wiring up test_live.py (needs secrets not provisioned for CI).
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 30747570815 -n agent -D /tmp/agent-30747570815
# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-30747570815/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-40807bcd7d5d0f8d-a1ac952a
git update-ref refs/heads/agent/maintenance/issue-11-40807bcd7d5d0f8d refs/bundles/create-pr-agent-maintenance-issue-11-40807bcd7d5d0f8d-a1ac952a
git checkout agent/maintenance/issue-11-40807bcd7d5d0f8d
# 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-40807bcd7d5d0f8d-a1ac952a
# Push the branch to origin
git push origin agent/maintenance/issue-11-40807bcd7d5d0f8d
# Create the pull request
gh pr create --title 'chore: add CI workflow to run offline unit tests on push/PR' --base main --head agent/maintenance/issue-11-40807bcd7d5d0f8d --repo pinecone-io/bird-search-example
Problem
The repository has no
.github/workflows/directory at all, so nothing runstests/test_query.py— the 10 offline unit tests that mockpinecone.Pineconeandgoogle.genai.Clientat import time and need no network access or API keys. A dependency bump or code change could silently breakquery.py's request-shape assumptions with nothing catching it before merge.Solution
Add
.github/workflows/ci.yml: a single job that installsrequirements.txtpluspytest, then runspytest tests/test_query.pyon everypushandpull_request. It uses an explicit least-privilegepermissions: contents: readblock and fails the job on any non-zero pytest exit code (the default behavior of a failing shell step).tests/test_live.pyis intentionally excluded — its own docstring notes it hits the real Pinecone/Gemini index and requires live credentials this repo doesn't provision for CI.Verification
Confirmed locally (offline, no live credentials):
Note: the mocked tests patch
sys.modules["pinecone"]/sys.modules["google.genai"]beforequery.pyimports them, so onlypython-dotenvneeds to actually be importable forquery.py's module-levelload_dotenv()call — the workflow still installs the fullrequirements.txtto match a real CI environment and catch install-time breakage too.Follow-ups
Out of scope here, per the issue: linting/formatting enforcement, coverage thresholds, a build/release pipeline, and wiring up
test_live.py(needs secrets not provisioned for CI).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: