Repository navigation
Tests, cleanup and bug fixes (Nov 2026 audit, 1 of 2) - #10
Merged
Merged
Conversation
- conftest.py makes the suite runnable in a clean environment (it previously died at collection without ADMIN_*/LAVALINK_* env); suite goes 30 -> 161 tests, coverage 49% -> 94% - New tests: StateStore, docker_ctl, oauth rotate, /healthz contract, HTTP login/middleware flow, config router, track tester, log filters, tokens, cipher/pot/lavalink services, shipped application.yml contract - Fixes: StateStore bare-filename crash, dead NotFound branch in stream_logs, .tmp litter on YAML dump failure - log_watcher: extract process_log_line() testable seam; unused imports removed (pyflakes clean)
…rraform fmt) Pushed via the cycle-five-muse-personal app: the built-in Meta Muse app does not request the workflows permission, so it could not push .github/workflows/* (403). Verified locally before push: 161 tests pass in a clean env, pyflakes clean, compose config and terraform fmt checks pass.
…path test_get_settings_and_get_state_are_cached called the real get_state(), which makedirs /state (the production state_path default). Passed locally as root; PermissionError on the GitHub runner (160/161 passed in run 41576335082). The test is now hermetic: tmp state path + cache_clear around the check. test_settings_defaults still pins the /state default. Local re-run: 161 passed, no /state created.
Contributor
|
CI is now on this PR — and green. Correction to the PR description:
|
cycle-five-muse-personal
Bot
deleted the
cleanup/tests-and-fixes-2026-11
branch
November 3, 2026 04:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First maintenance pass since April 2026. Full write-up of the audit lands in PR 2 (
docs/AUDIT-2026-11.md, stacked on this branch).Headline
The test suite did not run in a clean environment:
app.mainbuildsSettings()at import time, so collection died with a pydanticValidationErrorunlessADMIN_PASSWORD/ADMIN_SECRET_KEY/LAVALINK_PASSWORDwere set — and with no CI, nothing noticed.Tests: 30 -> 161, coverage 49% -> 94%
admin/tests/conftest.py: supplies test env before anyappimport (setdefault, real env wins), resets the global config lock per test, lifespan-freeclient/authed_clientfixtures (no APScheduler / Docker log tail in tests)./healthzcontract (Lavalink critical, cipher/pot advisory), HTTP-level login/middleware flow, config-router conditional writes, track tester branches, log filters, tokens masking/status, cipher/pot/lavalink services, settings, and a contract test pinning the shippedapplication.ymlpaths thatsetup.sh(indentation-keyed sed) and the PoT/OAuth writers depend on.pyproject.toml: pytest testpaths + asyncio fixture loop scope pinned,pytest-covin dev deps.Bugs the new tests caught (fixed here)
StateStore._ensure_dircrashed on a bare-filename state path (os.makedirs("")).docker_ctl.stream_logshad a deadexcept docker.errors.NotFoundbranch — a missing container reported "Stream interrupted" instead of "not found".write_config_to_diskleft a partial.tmpbehind when the YAML dump itself failed.log_watcher: extractedprocess_log_line()from the infinite loop as a testable seam; unused imports removed across app/tests (pyflakes clean).Held back from this PR
.github/workflows/ci.yml(pytest+coverage, pyflakes,docker compose config -q,terraform fmt -check— all verified locally) could not be pushed: the Muse GitHub App lacks the workflows permission on this repo, so GitHub rejects any tree containing.github/workflows/*. It will be added as a follow-up commit the moment that permission is granted (same grant as the kharon app needed).Verification
161 passedin a clean env (no env vars set), coverage 94%; pyflakes clean;docker compose config -qandterraform fmt -checkpass with the real binaries.PR 2 (stacked on this branch) carries the dependency/config changes from the same audit: youtube-plugin 1.18.2, LavaSrc 4.8.3, Lavalink pinned 4.2.2, yt-cipher IAS variant.