Skip to content

Commit 0bf0110

Browse files
docs: update CHANGELOG and pytest logging for improved visibility
- Enhanced `CHANGELOG.md` to include a new entry for improved pytest logging, which now prints progress messages during session start and test collection to avoid confusion during execution. - Updated `api/test/tests/conftest.py` to implement a `_pytest_log` function that provides visible progress updates, enhancing the user experience during testing. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1cddc75 commit 0bf0110

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ All contributors (including maintainers) should update `CHANGELOG.md` when creat
7878

7979
- **Postgres and publish pins**: Compose and CI use **`postgres:16.4`** only (removed **`docker-compose.ci.yml`**, **`COMPOSE_DB_IMAGE`**, and **`DB_VERSION`**). [**`publish.yml`**](.github/workflows/publish.yml) **`check-pinned-tags`** enforces **`AFP_VERSION`** only; **`set-version-db`** writes tag **`16.4`**.
8080

81+
### Improved
82+
83+
- **Pytest logs**: [`api/test/tests/conftest.py`](api/test/tests/conftest.py) prints **`[pytest]`** progress after Django settings load (sessionstart ffprobe / collection_finish) so long **collection** does not look like a hang.
84+
8185
### Changed
8286

8387
- **Audio Fingerprinter**: Default and dev example **`AFP_VERSION`** **`v1.4.4`** ([**Release 1.4.4**](https://github.com/BehindTheMusicTree/audio-fingerprinter/releases/tag/v1.4.4)) in [`docker-compose.yml`](docker-compose.yml) and [`env/dev/.env.compose.dev.example`](env/dev/.env.compose.dev.example) / [`env/dev/.env.dev.example`](env/dev/.env.dev.example). Set GitHub repository variable **`AFP_VERSION`** to **`v1.4.4`** (or **`1.4.4`** per existing publish convention) so CI and publish match.

api/test/tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ def _require_optional_services_enabled() -> None:
198198
)
199199

200200

201+
def _pytest_log(msg: str) -> None:
202+
"""Visible progress during sessionstart/collection (avoids 'hangs' after Django settings load)."""
203+
print(f"[pytest] {msg}", flush=True)
204+
205+
201206
def pytest_sessionstart(session: Session) -> None:
207+
_pytest_log("sessionstart: checking ffprobe (after Django settings; next is test collection)")
202208
ffprobe = shutil.which("ffprobe")
203209
if ffprobe is None:
204210
pytest.exit(
@@ -222,6 +228,7 @@ def pytest_sessionstart(session: Session) -> None:
222228
)
223229
wav_fixture = Path(__file__).parent.parent / "utils" / "uploaded_track" / "files" / "duration=472s.wav"
224230
if wav_fixture.exists():
231+
_pytest_log(f"sessionstart: probing WAV fixture ({wav_fixture.name}, timeout 30s)")
225232
probe_result = subprocess.run(
226233
[ffprobe, "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", str(wav_fixture)],
227234
capture_output=True,
@@ -235,6 +242,7 @@ def pytest_sessionstart(session: Session) -> None:
235242
f"ffprobe output: {err or probe_result.returncode}",
236243
returncode=2,
237244
)
245+
_pytest_log("sessionstart: ffprobe checks OK; collecting tests (this can take a while with no output)")
238246

239247

240248
def pytest_configure(config):
@@ -336,6 +344,7 @@ def _check_musicbrainz_reachable() -> tuple[bool, str]:
336344

337345

338346
def pytest_collection_finish(session: Session) -> None:
347+
_pytest_log(f"collection_finish: {len(session.items)} items; checking optional services / e2e reachability")
339348
_require_optional_services_enabled()
340349
if not _run_has_e2e_tests(session):
341350
return

0 commit comments

Comments
 (0)