Test/harness foundation#90
Merged
Merged
Conversation
Layer 1+2 of the test architecture from ai/test-infrastructure.md:
- code"""...""" interpolator with dotty-language-server-style predefined
markers (m1..m20): strips margins and ${marker} tokens, recording each
marker's 0-indexed LSP position in the final text
- TestWorkspace: compiles source strings with in-process dotc against the
test runtime classpath and exposes the resulting TASTy through a fresh
ProjectIndex/SymbolIndex — real-compilation index tests without frozen
fixture JARs
- Specs cover marker positions, per-file URI keying, cross-file subtype
links, double-index determinism, and failed-compilation acquisition
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Layer 3 of the test architecture (ai/test-infrastructure.md): - TestClient: implements the smithy-generated SlsLanguageClient (captures diagnostics and window messages) and simulates VS Code's event grammar — incremental didChange ranges against a client-side buffer, buffer written to disk before didSave, version counters per file - TestServer: wires a real ServerImpl around a TestWorkspace with stubs for the heavy externals: BSP answers only inverse-sources for one synthetic target, CSP is backed by an in-process dotc compile producing real TASTy jars (no zinc), PC provider is inert (the synthetic target's Scala version keeps PC paths off), lifecycle starts Ready (bootstrap would index the JDK) - TestClientSpec: open/edit/save flows into the index through the fake CSP; determinism property (post-session index equals fresh index of the final content); client buffer/disk consistency - TestComputationQueue extracted from DocumentSyncTests into util Production fixes found along the way: - PresentationCompilerProvider.instance leaked scache's Resource scope (`.use(cache => IO(provider))` released the cache while the provider escaped with it); instance now returns Resource - PresentationCompilerProvider is now a trait (CachingPresentationCompilerProvider is the scache-backed impl) so tests can stub it Note: `./mill sls.test --only` may execute weaver tests without reporting results — verify against a full `./mill sls.test` run. The task-level NoClassDefFoundError(UnsafeNonFatal) is com-lihaoyi/mill#7066 teardown noise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PC-backed feature tests (completion/hover/definition via a real-PC TestServer mode + code-marker assertions) and protocol conformance tests (handshake, unopened-file requests, cancellation, Cold/Failed behavior), written at the TestClient level so they survive the Phase 8 worker split. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.