Expand regression coverage for part files, long paths, and WebServer/REST
Summary¶
emulebb-build-tests already has meaningful seam coverage for part-file persistence, hashing,
long-path filesystem helpers, source exchange, and pipe/API seams. The current gap is not
test infrastructure anymore; it is missing end-to-end regression slices in the exact areas
where main now differs most from community and where stabilization work is expected next.
This item expands regression coverage around:
- part-file persistence and hash-writeback hardening
- long-path shell/UI and share-recursion tails
WebServer.cppHTML + JSON/REST behavior
The first long-path slices are now implemented on the active stabilization branches:
- deep Unicode delete routing with recycle-bin enabled vs disabled
- path-helper regressions for module-path growth, MediaInfo path joins, canonicalization, and MiniMule resource URLs
- shell/UI seam regressions for shortcut ignore rules, icon/display fallback routing, picker path normalization, and skin-resource resolution
- helper-architecture regressions for shared extended-length prefix handling, trailing-separator normalization, and INI/path-helper consolidation
- exact-name path regressions for leading/trailing dots, ASCII spaces, NBSP/EM SPACE, and reserved DOS device-looking names
- shared-directory recursion regressions for canonical path matching, options/shared-tree unification, junction alias dedupe, and junction-loop suppression
- long-config live UI stability coverage for explicit
-cprofile roots, settings edit/save, relaunch persistence, and repeated close/save cycles
Priority Scenarios¶
Part files¶
- stale hash result rejection when layout generation changes
- part.met replace/backup behavior on deep Unicode paths
- part-file delete/remove flows initiated from the UI
- preview/archive readiness checks around low-free-space thresholds
Long paths¶
- [x] deep Unicode delete with recycle-bin disabled
- [x] deep Unicode delete with recycle-bin enabled
- [x] shell/path-helper fallback behavior for browse/canonicalize/module-path helpers
- [x] shell/UI seam behavior for picker normalization, icon/display fallback gating, shortcut ignore rules, and skin-resource resolution
- [x] shared helper behavior for prefix stripping and directory-path normalization after helper consolidation
- [x] canonical path equivalence across
\\?\, 8.3 aliases, slash variants, and dot-segments - [x] exact-name path handling for leading/trailing dots, leading/trailing whitespace, and reserved DOS device-looking names
- [x] shared-directory recursion dedupe/loop protection for junction aliases by filesystem identity
- [x] live UI stability with explicit
-cconfig roots under overlong paths, including settings persistence across relaunch
WebServer / REST¶
- [x] legacy HTML routes still render after REST routes are added
- [x] REST routes require the landed
X-API-Keyauth model and never fall back to HTML login/session handling - [x] targeted native route/contract tests cover representative read and mutation mapping for
/api/v1 - [x] isolated live REST E2E covers auth failures, representative read routes, HTML-vs-REST separation, real server-connect activity, Kad running state, and one real search lifecycle
- [x] the live REST lane now runs from the deterministic seeded profile under explicit
-ignoreinstances -c <profile-base>isolation - [x] the live REST lane is strict pass/fail and records the failing phase plus the last observed server/Kad state when readiness does not complete
- [x] HTTPS cert/key loading works with non-ASCII and deep paths
Acceptance Criteria¶
- [x] New regression coverage exists for at least one part-file delete/remove flow
- [x] New regression coverage exists for long-path recycle-bin vs direct-delete behavior
- [x] New regression coverage exists for canonical/exact-name path handling and shared-directory recursion behavior
- [x] New WebServer route tests cover both existing HTML and new REST JSON surfaces
- [x] Targeted test slices are easy to run during stabilization work, not only broad full-suite runs
Current Profiling Workflow And Evidence¶
The current supported startup profiling path is:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\scripts\startup-profile-scenarios.py
Latest startup profiling evidence captured for current eMule-main Debug:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\reports\startup-profile-scenarios\20260418-121956-eMule-main-debug\startup-profiles-wrapper-summary.json
Shutdown timing is currently captured by deterministic live-profile probes rather than by a first-class operator-facing wrapper. Current evidence is:
EMULE_WORKSPACE_ROOT\scratch\shutdown-probe-20260418-122546-profiling\summary.jsonEMULE_WORKSPACE_ROOT\scratch\shutdown-repeat-20260418-122927\summary.json
Current operator note:
- prefer direct close observation plus main-window disappearance, final "no windows" observation, and process-exit timing
- do not treat higher-level automation
close()timing by itself as authoritative; it can overstate shutdown trouble relative to the app's visible shutdown path
Latest long-config live UI stability evidence:
- harness:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\scripts\config-stability-ui-e2e.py - runner:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\scripts\config-stability-ui-e2e.py - passing report:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\reports\config-stability-ui-e2e\20260418-195737-eMule-main-debug\ui-summary.json
Current REST regression coverage evidence:
- native targeted suite:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\src\web_api.tests.cpp - live harness:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\scripts\rest-api-smoke.py - runner:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\scripts\rest-api-smoke.py - passing release report with full live connect/search flow:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\reports\rest-api-smoke\20260419-211847-eMule-main-release\result.json - the current canonical lane now records
failed_phase, per-phase history, and last observed server/Kad state directly inresult.jsonwhen live readiness fails - latest Release REST smoke after the LF policy and REST log-alias fixes:
EMULE_WORKSPACE_ROOT\repos\emulebb-build-tests\reports\rest-api-smoke\20260425-105048-eMule-main-release TEST-034coverage throughcac7b93adds live Shared Files UI stress lanes for startup interruption, warm recovery, files-page recovery, repeated cycles, many-file cases, and shutdown startup-cache skip behavior
Current part-file delete/remove regression evidence:
- app seam commit
1b3f949exposes the inert part-file delete-path plan used byCPartFilemetadata cleanup and full part-file deletion - test commit
9d13806covers metadata-only companion cleanup and full.part.met/.part/.part.met.bak/.part.met.backupdelete planning on real temp storage - validation:
python -m emule_workspace validate - targeted evidence:
repos\emulebb-build-tests\build\eMulebb-workspace-v0.72a-eMule-main\x64\Debug\emule-tests.exe --no-intro --no-version --test-suite=parity --test-case="Part-file persistence seam models*"passed with 2 test cases and 37 assertions - full lane evidence:
python -m emule_workspace test all --config Debug --platform x64passed with native parity/web API suites green; live-diff completed with expected main-only seam mismatch warnings
Current HTTPS cert/key long-path evidence:
- app seam commit
0acc275moves WebServer TLS PEM loading behindWebSocketTlsSeams::TryLoadPemFileForMbedTls(), preserving the existing mbedTLS parse flow while routing both certificate and key reads through the shared long-path byte reader and appending the PEM parser NUL terminator. - test commit
6d92a74adds a native web API seam regression that writes cert/key payloads beside an overlong Unicode fixture path, reloads them through the WebSocket TLS seam, verifies exact byte preservation, and checks the appended NUL byte expected by mbedTLS. - validation:
python -m emule_workspace validate - app build:
python -m emule_workspace build app --config Debug --platform x64 - full lane evidence:
python -m emule_workspace test all --config Debug --platform x64passed with native parity/web API suites green; live-diff completed with expected main-only seam mismatch warnings
Relationship To Existing Items¶
- BUG-022 is the first landed long-path regression slice in this item
- FEAT-010 now contributes delete, path-helper, shell/UI, exact-name, and shared-directory recursion regressions here
- FEAT-022 now has direct live coverage here through the long-config
-cstability suite - the final FEAT-010 cleanup pass also moves the tests onto the permanent
PathHelpers/ShellUiHelpers/Ini2Helpershelper surface - the final hardening pass adds real-FS junction tests and an MSVC whole-program-optimization workaround for
upnp_impl_minilib.tests.cpp, which was hitting an unrelated Release ICE during the expanded suite - FEAT-013 is now paired with native REST contract tests and a live HTTP smoke slice