Skip to content

test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139)#317

Merged
hyperpolymath merged 1 commit into
mainfrom
qa-139-vscode-smoke
May 21, 2026
Merged

test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139)#317
hyperpolymath merged 1 commit into
mainfrom
qa-139-vscode-smoke

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Acceptance-criteria mapping (from #139)

# AC bullet Test
1 Extension activates without error AC1extensions.getExtension(...).activate() resolves; isActive is true
2 All five affinescript.{check,eval,compile,format,restartLsp} register and run AC2a — all five appear in getCommands(true). AC2bexecuteCommand on each resolves without throwing
3 LSP client starts, attaches, and restartLsp cycles it cleanly AC3 — two back-to-back restartLsp invocations both resolve. (Full attach path activates only when affinescript-lsp is on PATH; CI exercises the documented showWarningMessage short-circuit. Set AFFINESCRIPT_LSP_PATH to a real binary to drive the attach branch.)
4 Disposables cleaned up on deactivate AC4 — calls the extension's exported deactivate() and asserts it resolves without throwing

Files

  • editors/vscode/test/runTest.js — driver: downloads VS Code, launches with --extensionDevelopmentPath + --extensionTestsPath.
  • editors/vscode/test/suite/index.js — Mocha entry the host invokes; discovers *.test.js.
  • editors/vscode/test/suite/extension.test.js — the four acceptance tests above.
  • editors/vscode/package.json — adds @vscode/test-electron, mocha, glob to devDependencies; adds npm test script.
  • .github/workflows/ci.yml — new vscode-smoke job.
  • .claude/CLAUDE.md — second Runtime Exemption row.

Test plan

  • Local: from editors/vscode/, fetch deps and run xvfb-run npm test (or npm test on a desktop session) — all four acceptance tests pass against the checked-in out/extension.cjs.
  • CI: the new vscode-smoke job goes green on this PR.
  • Manual cross-check: install the packaged .vsix in VS Code, open a .affine file, run each of the five commands — observed behaviour matches what the harness asserts.

Closes #139.

Generated with Claude Code

#139)

Adds editors/vscode/test/ — a headless extension-host runner that loads
the compiled out/extension.cjs in a real VS Code and asserts the four
acceptance bullets from #139:

  1. activation without error
  2. all five affinescript.* commands register and invoke
  3. restartLsp cycles cleanly (back-to-back invocations resolve)
  4. deactivate resolves without throwing

Wires a vscode-smoke job into .github/workflows/ci.yml (Node 20 +
xvfb-run + `npm test`). The compiled extension.cjs is already checked
in (#35 Phase 3), so the smoke job needs only the Node-side test deps —
not the OCaml toolchain.

The Node-only runner is recorded as the second Runtime Exemption in
.claude/CLAUDE.md, paralleling the existing affine-vscode-publish.yml
carve-out (#104). Scope is strictly editors/vscode/test/; no production
code adopts Node.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 7eeb3d8 into main May 21, 2026
0 of 14 checks passed
@hyperpolymath hyperpolymath deleted the qa-139-vscode-smoke branch May 21, 2026 00:12
hyperpolymath added a commit that referenced this pull request May 21, 2026
* test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139)

Adds editors/vscode/test/ — a headless extension-host runner that loads
the compiled out/extension.cjs in a real VS Code and asserts the four
acceptance bullets from #139:

  1. activation without error
  2. all five affinescript.* commands register and invoke
  3. restartLsp cycles cleanly (back-to-back invocations resolve)
  4. deactivate resolves without throwing

Wires a vscode-smoke job into .github/workflows/ci.yml (Node 20 +
xvfb-run + `npm test`). The compiled extension.cjs is already checked
in (#35 Phase 3), so the smoke job needs only the Node-side test deps —
not the OCaml toolchain.

The Node-only runner is recorded as the second Runtime Exemption in
.claude/CLAUDE.md, paralleling the existing affine-vscode-publish.yml
carve-out (#104). Scope is strictly editors/vscode/test/; no production
code adopts Node.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(vscode): document #139 smoke harness in README + CAPABILITY-MATRIX

- editors/vscode/README.md gains a "Smoke testing the compiled extension"
  subsection under Contributing: run instructions, what the harness
  asserts, the LSP-attach env-var escape hatch, pointer to the
  Runtime Exemption in CLAUDE.md.
- docs/CAPABILITY-MATRIX.adoc Node-CJS row gains the live-host smoke
  status (was missing — the row only attested the .cjs compile path).

Refs #139, PR #317.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <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.

[QA] In-editor end-to-end smoke test for the .affine VS Code extension

1 participant