Skip to content

ci: add workflow to run offline unit tests on push/PR #16

Description

@pinecone-groundskeeper

Problem

The repo has no .github/workflows/ directory — there is zero CI — despite having a real, offline-runnable pytest suite in tests/test_query.py (10 tests, mocks pinecone.Pinecone and google.genai.Client at import time, no network/API keys needed). Without a workflow, a dependency bump or code change can silently break query.py's request-shape assumptions with nothing catching it before merge.

Solution

Added .github/workflows/ci.yml:

  • Triggers on push and pull_request.
  • Least-privilege permissions: contents: read.
  • Installs from requirements.txt plus pytest, then runs pytest tests/test_query.py only — tests/test_live.py is intentionally excluded, since its own docstring documents it as requiring live credentials and not being run in CI.

Scoped narrowly per the issue: no linting/formatting, no coverage gates, no build/release pipeline, and test_live.py is not wired up.

Verification

Ran the exact command the workflow uses, from a clean virtualenv built only from requirements.txt + pytest (no PINECONE_API_KEY/GOOGLE_API_KEY set):

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

All 10 mocked unit tests pass, confirming the workflow's install + test steps work end to end. Also validated ci.yml parses as well-formed YAML.

Follow-ups

Out of scope here, tracked separately:

Closes #11

Generated by GitHub Maintenance Fixer · sonnet50 · 83.9 AIC · ⌖ 8.08 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 30699406529 -n agent -D /tmp/agent-30699406529

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-30699406529/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-a4bf97399a729a16-dec869bf
git update-ref refs/heads/agent/maintenance/issue-11-a4bf97399a729a16 refs/bundles/create-pr-agent-maintenance-issue-11-a4bf97399a729a16-dec869bf
git checkout agent/maintenance/issue-11-a4bf97399a729a16
# 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-a4bf97399a729a16-dec869bf

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

# Create the pull request
gh pr create --title 'ci: add workflow to run offline unit tests on push/PR' --base main --head agent/maintenance/issue-11-a4bf97399a729a16 --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