Skip to content

SLVS-3097 Run extension E2E test on master and on PRs that change it - #6854

Open
sophio-japharidze-sonarsource wants to merge 9 commits into
masterfrom
codex/slvs-3097-vsix-smoke-spike
Open

sophio-japharidze-sonarsource wants to merge 9 commits into
masterfrom
codex/slvs-3097-vsix-smoke-spike

Conversation

@sophio-japharidze-sonarsource

@sophio-japharidze-sonarsource sophio-japharidze-sonarsource commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What this adds

Adds one E2E test that checks the built extension works inside Visual Studio Community 18.12.12405.243. The test runs on the warp-custom-sonarlint-visualstudio runner, whose image installs that build since ci-ami-images #513 was promoted.

The test:

  1. Installs this build's signed VSIX into a fresh experimental profile.
  2. Opens a small C# project and checks that two Sonar S1481 issues appear.
  3. Removes one unused variable through the IDE and saves the file.
  4. Checks that its issue stays gone for five seconds while the other issue remains visible.

A COM message filter retries temporary busy calls for up to 30 seconds per call and restores the previous filter at cleanup. Failed Error List reads and busy retries restart the five-second check. Selecting zero tests fails the job. Results and diagnostic logs are saved for seven days.

build.yml also stops hard-coding the Build Tools cl.exe path and finds MSVC with vswhere, because the image now has full VS 18 Community instead of Build Tools 2022.

When it runs

  • Automatically on master: once after each successful push build.
  • Automatically on PRs: when the PR changes .github/workflows/extension-e2e.yml or anything under tests/e2e/.
  • Manually on any branch: open Actions → Build → Run workflow, select the branch, and enable extension-e2e. Or run gh workflow run build.yml --ref <branch> -f extension-e2e=true.

The test runs after the build's publication steps, so it does not block promotion or dogfood delivery. If a newer master commit cancels an in-progress run, that run's E2E is cancelled too. The next run tests a VSIX that includes the skipped commit.

Validation

Run 43216162122 (attempt 3), at 6f148f561 on the promoted warp-custom-sonarlint-visualstudio image:

  • Build passed on full VS 18.12 Community (MSBuild from …\18\Community\…).
  • Extension E2E (VS 18): Passed: 1, Failed: 0, Skipped: 0. Evidence is in the extension-e2e-vs18.12.12405.243 artifact.

Earlier attempts of that run landed on warm-pool instances that had been launched before promotion (old Build Tools 2022 image) and failed with Full Visual Studio not found. Once the pool had cycled, the run passed.

Earlier validation on #513's DEV image (run 43046475213) checked the artifact against the same run's signed VSIX: manifest identity inside the isolated profile, target finding 1 → 0, control finding 1 → 1, and the saved source edit.

One expected-build setting (E2E_EXPECTED_VS_VERSION) drives both the minor-version range used for discovery ([18.12,18.13)) and the harness's exact-version check. This checks IDE automation and diagnostics; it does not verify foreground/pixel rendering.

Follow-ups

  • Coverage on the earliest supported VS (17.0) depends on ci-ami-images #520 and a runner for it. That will be a separate PR.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

SLVS-3097

@datadog-sonarsource

datadog-sonarsource Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6f148f5 | Docs | View more details | Give us feedback!

Comment thread tests/smoke/Invoke-VsixSmoke.ps1 Resolved
Comment thread tests/smoke/Invoke-VsixSmoke.ps1 Resolved
Comment thread .github/workflows/vsix-smoke-spike.yml Resolved
@sonarqubecloud

Copy link
Copy Markdown

@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title SLVS-3097 Spike: installed VSIX smoke test on Visual Studio CI SLVS-3097 Add installed-VSIX end-to-end smoke test Oct 28, 2026
Comment thread .github/workflows/build.yml Resolved
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title SLVS-3097 Add installed-VSIX end-to-end smoke test SLVS-3097 Smoke-test installed VSIX on earliest and latest Visual Studio Nov 3, 2026
Comment thread .github/workflows/build.yml Resolved
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title SLVS-3097 Smoke-test installed VSIX on earliest and latest Visual Studio Add installed-VSIX smoke tests for supported Visual Studio versions Nov 10, 2026
@sophio-japharidze-sonarsource
sophio-japharidze-sonarsource changed the base branch from master to codex/slvs-3097-discover-msvc November 10, 2026 10:04
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title Add installed-VSIX smoke tests for supported Visual Studio versions Run installed-VSIX smoke test on master and optional PR builds Nov 10, 2026
Comment thread .github/workflows/build.yml Resolved
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title Run installed-VSIX smoke test on master and optional PR builds Run extension E2E test on master and optional PR builds Nov 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apart from some concerns regarding stability of DTE, looks like a good idea

Please also add COM busy state handling (if you haven't already)


namespace SonarLint.VisualStudio.E2E
{
public static class VisualStudioAutomation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Handle the COM Busy State (IOleMessageFilter)
If you launch or control Visual Studio out-of-process, Visual Studio's COM server will periodically reject calls with 0x8001010A (RPC_E_CALL_REJECTED) whenever it is busy parsing, building, or rendering. You must register an IOleMessageFilter on the calling thread to automatically retry requests:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in 0aae662 (tests/e2e/ComMessageFilter.cs). The test registers an IOleMessageFilter on its STA thread. RetryRejectedCall retries SERVERCALL_RETRYLATER (the RPC_E_CALL_REJECTED busy case) every 250 ms for up to 30 s per call, and cancels permanent rejections immediately. The previous filter is restored when the test finishes, and the number of busy retries is recorded in result.json. It passed in run https://github.com/SonarSource/sonarlint-visualstudio/actions/runs/43216162122.

Base automatically changed from codex/slvs-3097-discover-msvc to master November 11, 2026 15:57
…mage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/extension-e2e.yml Resolved
@gitar-bot

gitar-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 7 closed / 7 findings

Adds a Visual Studio VSIX E2E job with vault-backed restore and new PR/master triggers, which could disrupt builds or expose CI credentials if misconfigured.

Adds an E2E test that installs the built VSIX into Visual Studio 18.12 and checks that a Sonar S1481 issue is removed after an IDE edit while a control issue remains, with automatic runs on master and on PRs touching the workflow or tests/e2e. Six issues were resolved, including the runner label mismatch, COM property-get retry gaps, a null ExitCode check, and the stale DEV image references. The known behavior where a newer master push cancels an in-progress E2E run was accepted and left unchanged, so no open findings remain.

✅ 7 closed
✅ Quality: Workflow runner label disagrees with README and PR description

📄 .github/workflows/vsix-smoke-spike.yml:32 📄 tests/smoke/README.md:3-5 📄 tests/smoke/README.md:33-35 📄 tests/smoke/README.md:108-110
The README and PR description both say the smoke workflow uses the existing warp-custom-sonarlint-visualstudio runner. The workflow actually runs on warp-custom-pr-513-sonarlint-visualstudio-v20261028102646, a PR-specific image label with a timestamp. The README's CI evidence section (27 Oct) describes runs on the old runner. Readers following the docs will expect the existing runner. If the candidate image label expires, a dispatch will queue with no runner. Fix: either update the README and description to name the candidate full-IDE image, or switch runs-on back to the documented runner.

✅ Bug: Retry loop misses COM property-get rejections, so busy VS aborts run

📄 tests/smoke/Invoke-VsixSmoke.ps1:55-69 📄 tests/smoke/Invoke-VsixSmoke.ps1:198-205 📄 tests/smoke/Invoke-VsixSmoke.ps1:73-74
Wait-ForCondition retries only on a raw COMException or a MethodInvocationException that wraps one. The polled conditions mostly read properties: $dte.Solution.IsOpen, $dte.ActiveDocument.FullName, and $dte.ToolWindows.ErrorList.ErrorItems. When a COM property getter fails, for example with RPC_E_CALL_REJECTED while VS is still starting or loading the solution, PowerShell raises GetValueInvocationException (ETS getter rule). That type is not in the MethodInvocationException hierarchy (API hierarchy). Neither catch clause matches it, so the first transient 'call rejected' error ends the run instead of being retried, which makes the run flaky. No COM message filter is registered either, so these rejections are likely right after the DTE appears. Fix: also catch ExtendedTypeSystemException, which covers both the getter and method exceptions, and check that its InnerException is a COMException.

✅ Bug: Start-Process ExitCode can be null, so successful runs fail

📄 tests/smoke/Invoke-VsixSmoke.ps1:44-53 📄 tests/smoke/Invoke-VsixSmoke.ps1:141 📄 tests/smoke/Invoke-VsixSmoke.ps1:145
Invoke-BoundedProcess starts the process with Start-Process -PassThru and no -Wait, then reads $process.ExitCode after WaitForExit(ms). PowerShell 5.1 can leave ExitCode as $null here unless $process.Handle is read right after the start (SO 10262231). When that happens, $null -ne 0 is true and the script throws Process failed with exit code : devenv.exe even though devenv /ResetSettings or VSIXInstaller succeeded. On a runner with the full IDE, every attempt would then stop at initialize-profile or install-vsix. The PR's CI run never got past prerequisites, so this has not been tested yet. Fix: read and keep the handle right after starting the process, and treat a null exit code as an error with its own message.

✅ Bug: Main Build job moved onto the temporary PR #513 DEV runner image

📄 .github/workflows/build.yml:43 📄 .github/workflows/build.yml:45 📄 .github/workflows/build.yml:252-253 📄 .github/workflows/build.yml:278-279 📄 tests/smoke/README.md:33-37
This commit changes the build job's runs-on from the standard warp-custom-sonarlint-visualstudio image to the timestamped DEV image warp-custom-pr-513-sonarlint-visualstudio-v20261102114059. The build job is not limited to the smoke spike. It runs on every push to master/branch-*/dogfood-on-* and on every PR, and it uses the release-ready-build environment with release signing, Repox promotion and dogfood publishing (lines 45, 252-290). So once this merges, production-signed, promoted artifacts get built on an unpromoted image that hasn't been validated. Normal CI also breaks as soon as that temporary label is rebuilt or retired, which the README itself warns about at line 35. This goes against the PR's stated constraint that default push and PR builds keep their existing behavior, and it doesn't match full-release.yml and the README (lines 36-37), which still describe the standard image as the production runner. Fix: put runs-on: warp-custom-sonarlint-visualstudio back for build, or limit the DEV label to validation-only runs. The vswhere-based compiler discovery step can stay because it works on both images.

✅ Cross-PR: Stacked #6861 still points PR builds at the superseded DEV image

📄 .github/workflows/build.yml:56
Breaks when #6861 is rebased onto this head and its version of the build.yml runs-on line wins the conflict, and then a build runs for PR #6854 or for the connected-smoke branch.

How

  1. This PR moves the PR SLVS-3097 Run extension E2E test on master and on PRs that change it #6854 build to warp-custom-pr-513-sonarlint-visualstudio-v20261109135904 (.github/workflows/build.yml:56).
  2. SLVS-3097 Add connected-mode extension E2E test #6861 rewrites that same line to add github.head_ref == 'codex/slvs-3097-connected-smoke-spike', but it keeps the older label ...-v20261104092520 (SLVS-3097 Add connected-mode extension E2E test #6861 .github/workflows/build.yml:80).
  3. SLVS-3097 Add connected-mode extension E2E test #6861's connected-smoke dispatch docs also still pass connected-smoke-runner=...-v20261104092520.
  4. Since both PRs edit the same line, a rebase that keeps SLVS-3097 Add connected-mode extension E2E test #6861's side quietly sends these builds back to the older image. Those builds then either fail to find a runner or test an image that is not the current candidate.

Fix

Compared e62b8c8 with #6861 at 9c6fbbc

...and 2 more closed from earlier reviews

Verification Rules 2/3 met
Rules 1 failed 2 passed 1 not applicable

❌ Approved GitHub Actions runners - The new extension-e2e job uses the custom warp-custom-sonarlint-visualstudio label, which is not in the approved Windows list (warp-custom-windows-2022-s/m/l/xl); confirm it is a verified specialist label or migrate (policy: https://xtranet-sonarsource.atlassian.net/wiki/spaces/Platform/pages/3694231566/GitHub+Actions+Runners+-+GitHub).
✅ Internal artifact registries
✅ Repository license compliance

Functional validation No results

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@sophio-japharidze-sonarsource
sophio-japharidze-sonarsource marked this pull request as ready for review November 12, 2026 14:03
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource changed the title Run extension E2E test on master and optional PR builds SLVS-3097 Run extension E2E test on master and on PRs that change it Nov 12, 2026

This branch has not been deployed

No deployments
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