chore: clean up test infrastructure and tooling#83
Conversation
There was a problem hiding this comment.
1 issue found across 14 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/conftest.py">
<violation number="1" location="tests/conftest.py:70">
P2: `subprocess.Popen` pipes stdout without any reader, which can deadlock the uvicorn process once its output buffer fills. Redirect stdout to `DEVNULL` or inherit stdout instead of piping it.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
3a1b341 to
d8c7920
Compare
- Migrate from Poetry to uv - Add Makefile with lint, format, and test targets - Rewrite test suite: extract fixtures into conftest.py with pydantic-settings, split monolithic test into focused test functions - Wait for Cloud Tasks emulator before starting uvicorn in tests - Fix ScheduledRouteBuilder crash without GCP credentials by passing a dummy client in local mode - Use temp file for subprocess output to avoid pipe deadlocks - Remove no-op test_trigger_endpoint (route doesn't exist on test server) - Switch CI workflows to use Makefile targets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| try: | ||
| proc.wait(timeout=10) | ||
| except subprocess.TimeoutExpired: | ||
| proc.kill() |
There was a problem hiding this comment.
Missing proc.wait() after proc.kill() leaves zombie
Low Severity
After proc.kill() in the subprocess.TimeoutExpired handler, there is no proc.wait() call to reap the child process. This leaves a zombie process entry in the process table until the proc object is garbage collected. On Python 3.12+, this also emits a ResourceWarning. The standard pattern is to always call proc.wait() immediately after proc.kill().
d8c7920 to
6018a01
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| run: | | ||
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | ||
| PYPROJECT_VERSION=$(poetry version -s) | ||
| PYPROJECT_VERSION=$(uv version) |
There was a problem hiding this comment.
uv version output includes project name, breaking comparison
High Severity
The uv version command outputs the version in the format project-name version-number (e.g., fastapi-gcp-tasks 0.1.1), whereas the old poetry version -s outputted just the bare version string (e.g., 0.1.1). Since TAG_VERSION is extracted as a bare version like 0.1.1, comparing it against PYPROJECT_VERSION from uv version will always fail, blocking every PyPI publish.


Summary
lint,format, andtesttargetsconftest.pywith pydantic-settings, split monolithic test into focused test functionsdocker-compose.yamlTest Plan
ruff check,ruff format --check)🤖 Generated with Claude Code
Summary by cubic
Migrate from Poetry to uv and rebuild tests/CI around the Cloud Tasks emulator for reliable local and CI runs. Add readiness checks, fix queue parent construction, default region to us-central1, guard Scheduler locally, and prevent uvicorn deadlocks.
Refactors
Bug Fixes
Written for commit 6018a01. Summary will update on new commits.
Note
Medium Risk
Moderate risk due to broad tooling/packaging workflow changes (build/publish/CI dependency management) plus new subprocess- and Docker-based test infrastructure that can be flaky if environment assumptions differ.
Overview
This PR migrates packaging and automation from Poetry to
uv(andhatchling), replacingpoetry.lockwithuv.lock, updating PyPI publishing touv build/uv publish, and standardizing local commands via a newMakefile(make lint,make format,make test).CI is reworked to run tests against a Docker Compose Cloud Tasks emulator (new
docker-compose.yamland newCIworkflow with log capture on failure), while the lint workflow also moves touv sync+make lint. It also adds emulator-backed smoke tests that boot the example app underuvicornwith readiness checks, updates examples/docs defaults (region ->us-central1), and includes small reliability fixes (e.g., queue creation parent path construction and avoiding local Cloud Scheduler credentials via an anonymous client).Written by Cursor Bugbot for commit 6018a01. This will update automatically on new commits. Configure here.