Skip to content

Add CI and test coverage - #54

Merged
a-r-j merged 2 commits into
mainfrom
ci-tests
Oct 31, 2026
Merged

a-r-j merged 2 commits into
mainfrom
ci-tests

Conversation

@a-r-j

@a-r-j a-r-j commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • CI (.github/workflows/ci.yml): on pushes to main and on PRs it runs npm ci, compiles, lints, runs the tests under xvfb-run with coverage, fails below 85% line coverage, and uploads the coverage report.
  • Test runner: moved to @vscode/test-cli so coverage is measured inside the extension host. This replaces the hand-rolled runTest.ts and suite/index.ts.
  • Tests: 32 total.
    • Unit tests for the file extension → Mol* format mapping and the generated load commands.
    • Integration tests for command registration, activateFromFiles (single file, multi-select, nothing selected), activateFromFolder, and start (PDB ID, UniProt ID, cancelled input).
  • Coverage: 87% of lines. ESMFold isn't tested because it calls the live ESM Atlas API.

Bug fixes

  • .ent, .brk, .mcif, .bcif and .sd files were passed to Mol* under formats it doesn't recognise. The mapping now lives in src/formats.ts.
  • IDs and file URLs are now escaped with JSON.stringify before being written into the webview script.
  • Closing a panel threw an error because onDidDispose lost this.
  • Cancelling the start input box no longer tries to load AlphaFold entry "undefined".
  • Added the missing eslint config, so npm run lint runs again.

Also included

This branch also contains the pending molstar 4.8.0 / TypeScript 5 upgrade and the file-handling improvements from molstar_4.8.0, because the new tests depend on that behaviour.

Test plan

  • npm ci && npm run test:coverage on a clean checkout (macOS, VS Code 1.144): 32 passing, 87% lines
  • CI passes on this PR (Ubuntu + xvfb)

🤖 Generated with Claude Code

a-r-j and others added 2 commits October 31, 2026 13:40
- GitHub Actions workflow: npm ci, compile, lint, tests under xvfb with
  coverage, 85% line threshold, coverage artifact upload
- Switch to @vscode/test-cli (coverage from the extension host)
- Unit tests for format mapping / load commands; integration tests for
  all file/folder/start command paths
- Extract format mapping into src/formats.ts, fixing .ent/.brk/.mcif/
  .bcif/.sd format handling and escaping injected IDs/URLs
- Fix panel dispose losing `this`; ignore cancelled accession input
- Add missing eslint config
- Includes pending molstar 4.8.0 / TypeScript 5 upgrade and file
  handling improvements from the molstar_4.8.0 branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@a-r-j
a-r-j merged commit c932ee9 into main Oct 31, 2026
1 check passed
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