Skip to content

Add offline-safe GitHub Actions CI for backend test reliability (Bepo v0.4.1)#9

Merged
enlorik merged 2 commits into
mainfrom
copilot/add-github-actions-ci
May 13, 2026
Merged

Add offline-safe GitHub Actions CI for backend test reliability (Bepo v0.4.1)#9
enlorik merged 2 commits into
mainfrom
copilot/add-github-actions-ci

Conversation

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor

This PR adds a minimal GitHub Actions pipeline so backend tests run automatically on PRs and pushes to main, with explicit safeguards to prevent CLIP/Hugging Face model downloads in CI. It also tightens test/runtime documentation and dependency setup around isolated, local-state-independent test execution.

  • CI pipeline (.github/workflows/ci.yml)

    • Adds workflow Bepo CI
    • Triggers on:
      • pull_request
      • push to main
    • Runs on ubuntu-latest with Python 3.11
    • Installs runtime + dev test dependencies and executes python -m pytest tests/ -v
    • Sets explicit minimal workflow token permissions (contents: read)
  • Offline model-download guardrails

    • CI exports:
      • TRANSFORMERS_OFFLINE=1
      • HF_HUB_OFFLINE=1
    • Preserves existing test strategy that monkeypatches CLIP initialization to avoid network/model fetch paths
  • Test isolation hardening

    • tests/test_api.py fixture now also sets offline env vars defensively
    • Tests continue to run against temp DB_PATH and temp IMAGES_DIR, independent of local memories.db, images/, GUI, or a pre-running backend server
  • Dependency and docs alignment

    • Adds requirements-dev.txt with pytest and httpx
    • README testing section updated to use dev requirements and clarify that tests use temporary DB/files and disable model downloads
    • README now documents CI coverage on PR/push
# .github/workflows/ci.yml (excerpt)
env:
  TRANSFORMERS_OFFLINE: "1"
  HF_HUB_OFFLINE: "1"

steps:
  - uses: actions/setup-python@v5
    with:
      python-version: "3.11"
  - run: |
      python -m pip install --upgrade pip
      pip install -r requirements.txt
      pip install -r requirements-dev.txt
      python -m pytest tests/ -v

@enlorik enlorik marked this pull request as ready for review May 13, 2026 12:06
Copilot AI review requested due to automatic review settings May 13, 2026 12:06
@enlorik enlorik merged commit 77847b5 into main May 13, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an offline-safe GitHub Actions CI workflow to automatically run the backend test suite on PRs and pushes to main, while hardening tests against accidental Hugging Face/Transformers model downloads.

Changes:

  • Added a minimal GitHub Actions workflow that installs dependencies and runs python -m pytest tests/ -v with offline HF/Transformers env vars set.
  • Added requirements-dev.txt for test dependencies.
  • Updated tests and README to reinforce offline/no-model-download and isolated temp DB/filesystem behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/test_api.py Sets TRANSFORMERS_OFFLINE/HF_HUB_OFFLINE in the autouse fixture to defensively prevent model downloads during tests.
requirements-dev.txt Adds dev-only test dependencies (pytest, httpx).
README.md Updates test instructions and documents CI behavior + offline guardrails.
.github/workflows/ci.yml Adds CI workflow to run pytest on PRs and pushes to main with offline environment variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
@@ -252,11 +252,16 @@ Returns API version information and a list of available endpoints.
## Running Tests

```bash
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.

3 participants