Skip to content

Commit 9b0de09

Browse files
committed
fix: install release test extras
1 parent 9349efa commit 9b0de09

4 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install package and build tooling
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install ".[dev]" build
27+
python -m pip install ".[dev,qdrant,fastapi]" build
2828
2929
- name: Run tests
3030
run: python -m pytest
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
status: resolved
3+
trigger: "GH Actions release pipeline failed after publishing tag: ModuleNotFoundError: No module named 'qdrant_client' while collecting tests/test_qdrant_helpers.py and tests/test_qdrant_wrapper.py"
4+
created: "2026-05-15"
5+
updated: "2026-05-15"
6+
---
7+
8+
# Debug Session: Release Pipeline Missing Qdrant
9+
10+
## Symptoms
11+
12+
- Expected behavior: The tag-triggered release pipeline should run the pre-publish test gate successfully before building and publishing artifacts.
13+
- Actual behavior: The Release workflow `build` job failed during pytest collection because `qdrant_client` was not installed.
14+
- Error messages: `ModuleNotFoundError: No module named 'qdrant_client'` from `tests/test_qdrant_helpers.py` and `tests/test_qdrant_wrapper.py`.
15+
- Timeline: First observed when checking GitHub Actions after publishing a tag.
16+
- Reproduction: Push a `v*` tag so `.github/workflows/release.yml` runs and executes `python -m pytest` after installing only `".[dev]" build`.
17+
18+
## Current Focus
19+
20+
- hypothesis: The release workflow runs all tests but installs only development tooling, not optional extras required by default-collected integration tests.
21+
- test: Inspect release workflow install command and Qdrant tests' import behavior.
22+
- expecting: `release.yml` installs `".[dev]"`, while Qdrant tests import `qdrant_client` at module import time.
23+
- next_action: Install Qdrant/FastAPI extras in the release pre-publish test environment and lock the workflow contract in tests.
24+
25+
## Evidence
26+
27+
- timestamp: 2026-05-15
28+
finding: `.github/workflows/release.yml` installed `".[dev]" build`, then ran `python -m pytest`.
29+
- timestamp: 2026-05-15
30+
finding: `pyproject.toml` defines `dev` as pytest tooling only and defines `qdrant` separately as `qdrant-client>=1.7`.
31+
- timestamp: 2026-05-15
32+
finding: `tests/test_qdrant_helpers.py` and `tests/test_qdrant_wrapper.py` import `qdrant_client` during module collection, so a missing dependency is a collection error rather than a skipped test.
33+
- timestamp: 2026-05-15
34+
finding: `tests/test_fastapi.py` skips when FastAPI/httpx are missing, but installing the `fastapi` extra in the release gate lets that integration coverage run too.
35+
- timestamp: 2026-05-15
36+
finding: After installing Qdrant locally, focused tests exposed `NameError: name 'inspect' is not defined` in `ensure_collection()`.
37+
38+
## Eliminated
39+
40+
- hypothesis: Trusted Publishing failed.
41+
reason: The failure occurred in the `build` job before artifact publishing jobs.
42+
- hypothesis: The package forgot to declare the Qdrant extra.
43+
reason: `pyproject.toml` declares `qdrant = ["qdrant-client>=1.7"]`.
44+
45+
## Resolution
46+
47+
- root_cause: Release workflow test environment did not install optional extras required by tests included in the full pytest suite.
48+
- fix: Changed release workflow install command to `python -m pip install ".[dev,qdrant,fastapi]" build` and imported `inspect` in `corpulse/integrations/qdrant.py`.
49+
- verification: Run release workflow contract test and Qdrant/FastAPI tests locally.
50+
- files_changed:
51+
- `.github/workflows/release.yml`
52+
- `corpulse/integrations/qdrant.py`
53+
- `tests/test_release_workflow.py`
54+
- `.planning/debug/release-pipeline-missing-qdrant.md`

corpulse/integrations/qdrant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111
from __future__ import annotations
1212

13+
import inspect
1314
import re
1415
import uuid
1516
from collections.abc import Sequence

tests/test_release_workflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_release_workflow_builds_and_uploads_artifacts():
3131
assert "workflow_dispatch:" in content
3232
assert "tags:" in content
3333
assert '"v*"' in content
34+
assert 'python -m pip install ".[dev,qdrant,fastapi]" build' in content
3435
assert "python -m pytest" in content
3536
assert "python -m build" in content
3637
assert "actions/upload-artifact@v4" in content

0 commit comments

Comments
 (0)