Skip to content

test: add Gradio UI smoke test and CI test job - #17

Merged
strbck merged 1 commit into
mainfrom
claude/tender-carson-389468
May 16, 2026
Merged

test: add Gradio UI smoke test and CI test job#17
strbck merged 1 commit into
mainfrom
claude/tender-carson-389468

Conversation

@strbck

@strbck strbck commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/test_ui_smoke.py with 5 assertions verifying the Gradio demo Blocks object and key UI components (run_btn, file_input, gallery, log_output) are constructed with the correct Gradio types on startup
  • Updates .github/workflows/ci.yml with a new test job that installs lightweight deps (pytest, gradio, numpy) and runs pytest tests/ before the Docker build step
  • Heavy ML libraries (insightface, onnxruntime, cv2) are not installed in CI — they're already stubbed by the existing conftest.py

How it works

ui/app.py calls load_models() at module level, so the smoke test uses importlib.util.spec_from_file_location to load the module fresh and patches refacer.models.load_models with a MagicMock before execution. This keeps the test entirely offline and dependency-light.

Reviewer notes

  • The test job runs in parallel with the build job; both must pass on PRs targeting main
  • No model files or GPU are needed — the test environment only requires gradio to be importable

🤖 Generated with Claude Code

Adds tests/test_ui_smoke.py to verify the Gradio demo object and key UI
components build correctly without model files. Updates CI to run pytest
in a lightweight Python env before the Docker build step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@strbck
strbck merged commit 86de9b5 into main May 16, 2026
2 checks passed
@strbck
strbck deleted the claude/tender-carson-389468 branch May 16, 2026 13:23
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.

1 participant