Repository navigation
fix(flaskapi): V4 env-enum guard, unit-tier marker, per-test persistence isolation (T26) - #715
JavierGOrdonnez wants to merge 5 commits into
Conversation
…OYMENT_MODE getters; loose placeholder tests become out-of-range guards (fork #80) + sync uv.lock to 1.6.4.dev1
…V26) - suite green against dirty repo runs_local
…oject only, V34lt)
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## develop #715 +/- ##
===========================================
- Coverage 85.50% 76.12% -9.38%
===========================================
Files 109 109
Lines 13689 5324 -8365
Branches 1472 608 -864
===========================================
- Hits 11705 4053 -7652
+ Misses 1850 1084 -766
- Partials 134 187 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The lockfile will become stale after auto-tagging, and one isolation test depends on external filesystem state.
1 open finding
What changed in this PR
Enforces backend environment enums, isolates test persistence, and completes unit-tier test marking.
Changes:
- Validates deployment environment values with regression tests.
- Redirects persistent test storage to per-test temporary directories.
- Adds the missing unit marker and updates specification status.
| File | Description |
|---|---|
SPEC.md |
Marks persistence isolation complete. |
flaskapi/uv.lock |
Synchronizes the package version. |
flaskapi/tests/test_test_isolation.py |
Adds persistence-isolation regressions. |
flaskapi/tests/test_flask_deployment.py |
Tests valid and invalid enum values. |
flaskapi/tests/test_api_error_surface.py |
Adds the unit-tier marker. |
flaskapi/tests/conftest.py |
Introduces per-test temporary persistence paths. |
flaskapi/src/mmux_flaskapi/blueprints/deployment.py |
Enforces allowed environment values. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…(GH-Copilot ITISFoundation#715, B27rt) The isolation guard itself read SHARED container state (assert /text-files/v26.txt never exists) — exactly the pre-existing external state V26/B15 isolation must tolerate: a dev stack that had landed that file would fail a green suite. The successful read from the patched tmp dir is the hermetic proof the request used the isolated destination; reading the unpatched path adds external state, not coverage. Root SPEC §B27rt ledgers it. Suite: 600 passed, 3 skipped.

Three §V-violation fixes from the 2026-10-08
/checkdrift audit of SPEC.md. Rebased onto develop after #713 (its squash-merge took only the auto-tag lore commit; these three were left behind).Changes
1.
fix(flaskapi): §V4 enum-range enforcement — fork #80_get_required_env_varnow validates against allowed sets:SERVICE_MODE∈ {UQ, SUMO, MOGA},PERMISSIONS∈ {READ-ONLY, WRITE},DEPLOYMENT_MODE∈ {LOCAL, OSPARC}. Out-of-range values take the same JSON-500ErrorResponsepath as missing vars (endpoints already catchKeyError; sampling'sget_deployment_mode_valueis covered too).test_flask_deployment.pycodified the loose placeholder behavior (development,admin,DOCKER, empty string → 200); converted into valid-value tests + parametrized out-of-range guards.uv.lockresync (V34lt: the auto-tag bot stampspyproject.tomlbut notuv.lock, so everyuv runre-mutated the lock).2.
test(flaskapi): unit-tier marker — fork #82pytestmark = pytest.mark.unitontest_api_error_surface.py(V32qt). Oracle:pytest -m "not (unit or integration or analytical)"→ 0 selected.3.
test(flaskapi): per-test persistence isolation (T26 / §V26)conftest.py::isolate_persistence_dirsautouse fixture redirects thelocal_job_storeandtextfilestorage globals (+ env) to a freshtmp_pathper test; the request path reads the module globals, so no app-factory change is needed.tests/test_test_isolation.py: B15 regression — seeds the 27-collection dirty store, asserts the endpoint sees it while the reporuns_localstore stays byte-identical, and a real text-file write lands in tmp.Validation
runs_localstore present (the exact file that failed 9 tests before this fix; no env workaround).Closes JavierGOrdonnez#80
Closes JavierGOrdonnez#82