Skip to content

Test/harness foundation#90

Merged
rochala merged 3 commits into
mainfrom
test/harness-foundation
Jun 15, 2026
Merged

Test/harness foundation#90
rochala merged 3 commits into
mainfrom
test/harness-foundation

Conversation

@rochala

@rochala rochala commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

rochala and others added 3 commits June 13, 2026 22:50
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>
@rochala rochala merged commit fa83203 into main Jun 15, 2026
1 check passed
@rochala rochala deleted the test/harness-foundation branch June 15, 2026 19:42
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