Skip to content

test(snipper-vs): add mock-mode integration tests (VS SDK TestFramework) Adds Snipper.VisualStudio.IntegrationTests (net472) — four test classes using Microsoft.VisualStudio.Sdk.TestFramework.Xunit [VsFact] / MockedVS collection, which spins up a mocked VS service container so tests run on CI (windows-latest) without a real IDE install: - LspSnippetConverterVsTests — XmlDocument + XPath assertions on VS snippet XML - SnipperOptionsPageTests — property default / round-trip - SnipperBinaryLocatorTests — path resolution edge cases - TabstopInserterTests — full call-chain: PlainTextViewStub (no-op), ExpansionViewStub (records InsertSpecificExpansion), and CapturingXmlMemberIndexService (captures temp .snippet file content) Also adds vs-integration-tests CI job (windows-latest) and wires the new project into Snipper.VisualStudio.sln. https://claude.ai/code/session_01VRbhF1wSDh9FXKajAPUyqw - #11

Merged
PhysShell merged 2 commits into
mainfrom
claude/snipper-docs-lint-scaffold-pTNoL
Jun 3, 2026

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

No description provided.

Adds Snipper.VisualStudio.IntegrationTests (net472) — four test classes
using Microsoft.VisualStudio.Sdk.TestFramework.Xunit [VsFact] / MockedVS
collection, which spins up a mocked VS service container so tests run
on CI (windows-latest) without a real IDE install:

- LspSnippetConverterVsTests  — XmlDocument + XPath assertions on VS snippet XML
- SnipperOptionsPageTests     — property default / round-trip
- SnipperBinaryLocatorTests   — path resolution edge cases
- TabstopInserterTests        — full call-chain: PlainTextViewStub (no-op),
  ExpansionViewStub (records InsertSpecificExpansion), and
  CapturingXmlMemberIndexService (captures temp .snippet file content)

Also adds vs-integration-tests CI job (windows-latest) and wires the
new project into Snipper.VisualStudio.sln.

https://claude.ai/code/session_01VRbhF1wSDh9FXKajAPUyqw

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a40c8662e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
string? capturedPath = null;
var mockXmlService = new CapturingXmlMemberIndexService(path => capturedPath = path);
this.serviceProvider.AddService(typeof(SVsXMLMemberIndexService), mockXmlService, dispose: false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the mocked VS service before re-registering it

When both TabstopInserterTests run in the same MockedVS collection, they share the same GlobalServiceProvider fixture, so the SVsXMLMemberIndexService registered by the other test remains in the global service container. Registering the same service type again here makes the suite order-dependent and can fail before exercising TabstopInserter; reset/remove the service between tests or register one shared stub and update its captured state per test.

Useful? React with 👍 / 👎.

public-api: drop --locked from cargo install cargo-public-api so cargo
can pick dep versions compatible with rustc 1.85 (locked deps pulled in
cargo-util 0.2.21 / home 0.5.12 which require 1.86/1.88).

vsix-package darwin-x64: add explicit `rustup target add` step before
the build — dtolnay/rust-toolchain targets field does not always
install the cross-compile target on Apple Silicon runners.

https://claude.ai/code/session_01VRbhF1wSDh9FXKajAPUyqw
@PhysShell
PhysShell merged commit b5456bc into main Jun 3, 2026
32 of 38 checks 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.

2 participants