tests: przekieruj testy auth /clear_pr_pls po rozdzieleniu musician/radio #3

Merged
gitea merged 1 commits from fix-integration-auth-tests into main 2026-07-30 09:43:52 +00:00
Owner

Co jest grane

test_musician_auth.py dalej pukał do /clear_pr_pls na musicianie, a ten endpoint przeniesiony jest do betoniarki przy rozdzieleniu serwisów. Musician zwraca na niego 404 → trzy testy padają 404 != 401/200. Zaległy dług, niezwiązany z pracą nad AI/share/bridge — trzymał job integration na czerwono.

Naprawa dopasowana do architektury

  • test_musician_auth.py testuje ten sam kontrakt auth (bez klucza → 401, z kluczem → 200, klucz wyłączony → otwarte) na /get_share_list — endpoincie który musician nadal serwuje;
  • test_betoniarka_auth.py (nowy) pokrywa /clear_pr_pls tam gdzie teraz mieszka + /ping; PRIORITY_PLAYLIST_PATH wskazuje na tmp_path, żeby autoryzowany przypadek mógł wyczyścić plik;
  • conftest.py dokłada conjurer_betoniarka do sys.path.

Weryfikacja

Czysty venv (pytest flask waitress requests), dokładnie jak job integration: 13 passed (było 3 failed / 6 passed). Unit bez zmian.

Uwaga: koliduje trywialnie z PR #1 na conftest.py (obie dokładają katalog do tej samej krotki sys.path) — merge-order dowolny, konflikt jednolinijkowy.

## Co jest grane `test_musician_auth.py` dalej pukał do `/clear_pr_pls` na **musicianie**, a ten endpoint przeniesiony jest do **betoniarki** przy rozdzieleniu serwisów. Musician zwraca na niego 404 → trzy testy padają `404 != 401/200`. Zaległy dług, niezwiązany z pracą nad AI/share/bridge — trzymał job `integration` na czerwono. ## Naprawa dopasowana do architektury - `test_musician_auth.py` testuje ten sam kontrakt auth (bez klucza → 401, z kluczem → 200, klucz wyłączony → otwarte) na `/get_share_list` — endpoincie który musician **nadal** serwuje; - `test_betoniarka_auth.py` (nowy) pokrywa `/clear_pr_pls` tam gdzie teraz mieszka + `/ping`; `PRIORITY_PLAYLIST_PATH` wskazuje na `tmp_path`, żeby autoryzowany przypadek mógł wyczyścić plik; - `conftest.py` dokłada `conjurer_betoniarka` do `sys.path`. ## Weryfikacja Czysty venv (`pytest flask waitress requests`), dokładnie jak job `integration`: **13 passed** (było 3 failed / 6 passed). Unit bez zmian. > Uwaga: koliduje trywialnie z PR #1 na `conftest.py` (obie dokładają katalog do tej samej krotki `sys.path`) — merge-order dowolny, konflikt jednolinijkowy.
gitea self-assigned this 2026-07-29 22:40:13 +00:00
gitea added 1 commit 2026-07-30 09:42:58 +00:00
tests: retarget /clear_pr_pls auth tests after the musician/radio split
CI / compile (pull_request) Successful in 11s
CI / unit (pull_request) Successful in 12s
CI / integration (pull_request) Successful in 11s
build / build (push) Failing after 7s
CI / compile (push) Successful in 10s
CI / unit (push) Successful in 14s
CI / integration (push) Successful in 12s
491f957315
test_musician_auth.py still probed /clear_pr_pls on the musician, but that
endpoint moved to betoniarka during the split - the musician now 404s it, so
all three tests failed 404 != 401/200. This was pre-existing debt, unrelated to
the AI/share/bridge work; it just kept the integration job red.

Split the coverage to match the current architecture:
* test_musician_auth.py exercises the same auth contract (no key -> 401, key ->
  200, key unset -> open) against /get_share_list, an authenticated endpoint the
  musician still serves, with a valid body so the permitted case is a clean 200
  rather than a 400;
* new test_betoniarka_auth.py covers /clear_pr_pls where it now lives, pointing
  PRIORITY_PLAYLIST_PATH at a tmp file so the authorised case can truncate it,
  and checks /ping stays open;
* conftest.py adds conjurer_betoniarka to sys.path so the service imports.

Verified in a clean venv (pytest flask waitress requests), matching the CI
integration job: 13 passed, up from 3 failed / 6 passed. Unit suite unaffected
(23 passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gitea force-pushed fix-integration-auth-tests from efb671befa to 491f957315 2026-07-30 09:42:58 +00:00 Compare
gitea merged commit 491f957315 into main 2026-07-30 09:43:52 +00:00
gitea deleted branch fix-integration-auth-tests 2026-07-30 09:44:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/conjurer#3