Skip to content

test: characterize settings contract and real stdio lifecycle (S2) - #134

Merged
Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
test/s2-settings-contract
Nov 11, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
test/s2-settings-contract

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

Summary

Closes #132.

  • Add a two-file JSON settings corpus, with metadata separate from initializationOptions. Both the TypeScript producer tests and Python consumer tests read the same producer.json; a partial legacy payload captures Python-only compatibility behavior.
  • Characterize scope/contribution/Python defaults, empty and null values (including currently rejected inputs), unknown-key projection, shallow object replacement, hardcoded-global versus explicit-workspace precedence, real multi/nested-root URI routing, and staged document CWD resolution.
  • Protect retained top-level workspace_settings/global_settings aliases across real in-process InitializeParams applications, retained roots/keys, replacement values, and matched lookups returning stored objects. No per-workspace identity guarantee is introduced.
  • Add a test-only real ToolServer/pygls fixture and bounded LSP-over-stdio smoke test covering initialize, initialized, settings inspection, shutdown and exit. It uses UTF-8 byte lengths, matches response IDs through notifications, validates protocol-only stdout through EOF, drains stderr concurrently, verifies checkout import provenance, and always cleans up/reaps the child.
  • Document the fixtures and independent test runners in CONTRIBUTING.md.

Preserved behavior / scope

No production code, serialized wire shape, dependency/lockfile, workflow (including S1), version, or consumer policy changes. Workspace/global/Python fallback contexts remain distinct; global workspace remains a plain path; merges remain shallow and unknown global keys are not automatically propagated. Repeated helper application is tested in-process, never as a second initialize request on a live session.

The fixture endpoint exists only under python/tests/fixtures/. No formatter/linter installation, tool process, daemon, network, VS Code host, or cross-runner Node/Python launch dependency is required by these tests. Later settings/facade and process-manager refactors remain out of scope.

Validation

Validated on Windows with Python 3.13.14 and isolated Node 24.17.0 (matching .nvmrc). Python imports were explicitly bound to this worktree with PYTHONPATH; the isolated nox environment used pygls 2.1.1 / lsprotocol 2025.0.0, and the subprocess fixture verifies both parent and child source provenance.

Check Result
Focused Python test_server.py + test_server_stdio.py 113 passed
Focused TS workspace/global settings and restart selection 29 passed
python -m nox -s tests lint 346 passed, 2 skipped; 29 localization tests passed; lint passed
python -m nox -r -s lint with PYTHONUTF8=1, PYTHONIOENCODING=utf-8 Passed, including full Flake8, Black and isort checks without Windows encoding warnings
npm --prefix .\typescript test 148 passed
npm --prefix .\typescript run build Passed
npm --prefix .\typescript run lint Passed, 0 errors; 2 existing unused-disable warnings in src/vscodeapi.ts
Focused ESLint on changed TS test files Passed, 0 errors; naming warnings for domain-specific uppercase keys
Prettier check on the new JSON corpus Passed
git diff --check Passed

Other Python versions and Linux were not run locally; the existing CI matrix remains authoritative. The source-wide TS format check was intentionally not rerun or cleaned up: issue #132 records 14 pre-existing failures, and no TS production source changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91
@rchiodo

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@rchiodo

Copy link
Copy Markdown
Contributor

Reviewed commit: 8ab9d2e01eebac3a849a1d83046487c7345b8c6a

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Podman machine &#x27;pyrx-automation&#x27; is not running.

Test runs: none recorded.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 11, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit f99929b into main Nov 11, 2026
23 of 24 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the test/s2-settings-contract branch November 11, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Updates not included in the release notes or changelog review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[S2] Characterize Python settings contract and real stdio lifecycle

2 participants