Skip to content

Move raw-protocol server tests to the end-to-end tier - #682

Merged
Firehed merged 1 commit into
mainfrom
e2e-raw-protocol
Oct 6, 2026
Merged

Firehed merged 1 commit into
mainfrom
e2e-raw-protocol

Conversation

@Firehed

@Firehed Firehed commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stacked on #681.

Covers the raw-protocol cases of ServerTest on the end-to-end tier, and adds the first variation in client capabilities.

Client capabilities

  • Session\ClientCapabilities is what the client declares in initialize, one named field per variation a script needs. Script carries it, defaulting to nothing declared.
  • LspClient answers the server's client/registerCapability request with null, as an editor that accepts it would, and fails the test on any other server request.
  • Two scripts in transcripts/ cover watched-file registration, since the exchange itself is the point: one declares dynamic registration support and locks the server's registration and the client's answer; one declares nothing and locks that none is sent.

Raw-protocol tests

  • LifecycleTest gains: exit without shutdown exits 1, closed input exits 1, a request before initialize gets -32002, a request after shutdown gets InvalidRequest and exit still returns 0.
  • MessageErrorTest covers: an unknown method gets MethodNotFound; a frame that is not JSON gets ParseError at a null id; a frame that is JSON but not a valid request gets InvalidRequest at its own id. Each checks the session ends cleanly afterward.
  • Client\ErrorCode holds the specification's codes for these assertions, since nothing in the tier may depend on src/.

Originals

  • The two watched-file registration tests in ServerTest are removed: they used Server::forProject and the container, and the scripts cover them.
  • The other ServerTest cases build Server directly and test the read loop, so they stay.

Coverage: unchanged.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.73%. Comparing base (7f69765) to head (ee0397c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #682   +/-   ##
=========================================
  Coverage     99.73%   99.73%           
  Complexity     1900     1900           
=========================================
  Files           135      135           
  Lines          4873     4873           
=========================================
  Hits           4860     4860           
  Misses           13       13           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Firehed
Firehed added this pull request to stack #688 October 4, 2026 01:49
@Firehed
Firehed marked this pull request as ready for review October 6, 2026 04:24
@Firehed
Firehed force-pushed the e2e-raw-protocol branch 2 times, most recently from 72ff404 to b34c247 Compare October 6, 2026 04:45
Base automatically changed from e2e-typing-conversation to main October 6, 2026 04:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Firehed
Firehed merged commit aa8874f into main Oct 6, 2026
9 checks passed
@Firehed
Firehed deleted the e2e-raw-protocol branch October 6, 2026 04:51
Firehed added a commit that referenced this pull request Oct 6, 2026
## Summary

Stacked on #682.

Moves variable go-to-definition coverage (#301) onto the end-to-end
tier.

- `Marker\VariableMarker` addresses the `//jtd:name var` style: the last
`$var` on the marked line. A cursor marker cannot sit inside a variable
name without breaking the parse.
- `scripts/variable-definition.php` holds one case per case of
`VariableDefinitionTest`: assignments, parameters, foreach keys and
values, catch variables, the nearest of two assignments, shadowing,
closure `use` clauses, arrow-function fall-through, an uncaptured name
in a long closure, `$this`, global scope, and top-level closures. Each
expects the line the original asserted, or `NoAnswer()` where it
asserted none.
- `LandsOn` takes an optional `column:`. Columns are 1-based, like
lines. The four cases the original checked by column still are, and so
are three it did not: where another variable shares the binding's line
(a foreach key, a closure `use` clause, a top-level closure), a line
alone would also accept the wrong variable.
- The top-level closure `use` case expects its line; the original
accepted any location.
- `VariableResolutionTest` is a new unit test for the resolution paths
only `VariableDefinitionTest` reached: arrow-function capture from the
enclosing function, a top-level arrow function with no enclosing
function, and a top-level closure's `use` binding with no type. It
builds `SymbolResolver` directly, with a real parser and stubbed
knowledge interfaces.
- `VariableDefinitionTest` is removed.

Coverage: unchanged, file by file. Without the new unit test, removing
the original would have uncovered statements in `ExpressionResolver` and
`Scope`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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