Skip to content

Harden extension closeout coverage - #126

Merged
suraj-ranganath merged 1 commit into
feature/eegprep-extension-completionfrom
phase/6-extension-closeout
Jun 3, 2026
Merged

suraj-ranganath merged 1 commit into
feature/eegprep-extension-completionfrom
phase/6-extension-closeout

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Adds Phase 6 closeout coverage for real installed entry-point packages, lazy startup imports, disabled and no-plugin behavior, package data paths with spaces, and GUI/console failure isolation. Updates extension docs for no-plugins mode, disabled extensions, lazy loading, package resource portability, and the current shared runtime model. Verified focused extension suite, ruff check and format, ty check, non-slow pytest with MATLAB skipped, pre-commit, and autoreview clean.

Closes #118

@claude

claude Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 2m 32s —— View job


Code review

  • Overall assessment: Safe to merge.
  • Highest-risk area: Test brittleness in doc assertions (nit only).
  • Merge recommendation: Safe to merge.

This PR adds tests + docs only — no runtime/behavior changes. I verified every API the new tests touch against the source: ExtensionRegistry.discover(include_plugins=...), ExtensionRuntime.from_records/discover/menu_contributions/action(...).load(), ExtensionRecord.{entry_point_name,package_name,status,enabled,spec}, ExtensionResource.read_text, EEGPrepConsoleWorkspace.after_execute(source, *, success=...), and eeglab.main/console.main. All imports in test_extension_runtime.py (ExtensionPopFunction) and test_extension_integration.py (EXTENSION_ENTRY_POINT_GROUP) exist.

Spot-checks that confirmed the tests are correct rather than tautological:

  • package_name="wrong-local-name" in the alpha spec is correctly overridden to the distribution name eegprep-ext-phase6-alpha — exercises _entry_point_package_name resolving real dist.metadata["Name"] (extensions.py:510, :551, :938).
  • Provider order (phase6_beta, phase6_alpha) vs. asserted record order (alpha, beta) genuinely tests deterministic _record_sort_key normalization, not pass-through.
  • read_text() == '{"scale": 2}\n' correctly accounts for the trailing newline _write_package appends, and uses a resource path with a space — good portability coverage.
  • The subprocess startup test and --no-plugins test correctly guard laziness: the entry-point registration.py raises on import, so any eager discovery would fail the assertion.

Blocking

None.

Important

None.

Nits

  • tests/test_extension_docs.py:76 — assert "Windows paths with\nspaces" in text couples the assertion to the exact rST line wrapping of that paragraph in user_guide/extensions.rst. A harmless reflow or reword would break the test with no behavior change. Suggest asserting on a single-line phrase instead, e.g. assert "portable across editable installs" in text. (severity: nit)

Test gaps

None. The added coverage (lazy entry-point imports, disabled removal, no-plugins skip, package data with spaces, GUI/console failure isolation) matches the stated Phase 6 closeout goals.

EEGLAB parity notes

None. Extension-ecosystem infrastructure with no EEGLAB MATLAB equivalent; EEG-dict and pop_*/console semantics in the failure-isolation tests are consistent with repo conventions.


Note: I was unable to execute the test suite (uv run pytest was not permitted in this session), so verification is static. The review is based on reading the diff and confirming every referenced symbol/signature in the source.

@suraj-ranganath
suraj-ranganath force-pushed the phase/6-extension-closeout branch from a4230ff to 86992af Compare June 3, 2026 02:06
@suraj-ranganath
suraj-ranganath merged commit 656556f into feature/eegprep-extension-completion Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant