Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2ddb037
Add Code Action Apex tests based on TS
abonie Jul 12, 2026
b6fdb0d
Copy other integration tests to apex
abonie Jul 15, 2026
6c4ca07
Add orchestration for CI and fix missing assertion
abonie Jul 22, 2026
0c8b741
Remove Apex tests from slnx and gate on Insiders
abonie Jul 23, 2026
d1757c7
List VS instances
abonie Jul 23, 2026
f414963
Pin Apex 18.7
abonie Jul 24, 2026
2d4dbe9
Add more VS setup
abonie Jul 24, 2026
d2fd5fd
Debug logging
abonie Jul 25, 2026
2a772b0
Skip VS sign in
abonie Jul 26, 2026
fccb0c7
Start VS with an empty env
abonie Jul 27, 2026
19675db
Pin Roslyn packages differently for CI
abonie Jul 27, 2026
1596a31
Add missing eng/SetApexRoslynVersion.ps1 for the Apex Roslyn detectio…
abonie Jul 27, 2026
c0c3dd7
Roll System.Composition/Immutable back to 10.0.2 for the Apex leg
abonie Jul 28, 2026
1f2d505
Revert "Roll System.Composition/Immutable back to 10.0.2 for the Apex…
abonie Jul 28, 2026
07db08b
Add DartLab VS-integration pipeline scaffold for the F# Apex tests
abonie Jul 28, 2026
f846a7a
Point DartLab scaffold at the existing dnceng/internal/dotnet-fsharp …
abonie Aug 19, 2026
984c700
Align DartLab scaffold with Roslyn's current entry structure
abonie Aug 19, 2026
49e0e1b
Trigger F# Apex DartLab tests via /pr-val PR comment, not on VS builds
abonie Aug 20, 2026
3fd75ac
Merge remote-tracking branch 'origin/main' into apex-int-tests
abonie Aug 27, 2026
af194f0
Remove public-scout Apex CI leg and its Roslyn-version workaround
abonie Aug 27, 2026
8cf5f8a
Drop stale P4/P5 note from Apex README (both already done)
abonie Aug 27, 2026
8efe122
Run requested DartLab PR validation directly from GitHub
abonie Sep 23, 2026
1922e61
Use PowerShell for requested PR validation
abonie Sep 23, 2026
36cf069
Migrate Apex pipeline to DartLab-1ES
abonie Sep 30, 2026
997906c
Set F# Apex CloudTest lab
abonie Oct 5, 2026
12b6261
Merge upstream main into apex-dartlab-github
abonie Oct 5, 2026
a9f51f0
Run reviewed PR pipeline YAML for SHA-pinned DartLab requests
abonie Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Code Action Apex tests based on TS
  • Loading branch information
abonie committed Jul 12, 2026
commit 2ddb0377e9fa0b12358b9811b408a1984250214f
3 changes: 3 additions & 0 deletions VisualFSharp.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@
<Project Path="vsintegration/tests/FSharp.Editor.IntegrationTests/FSharp.Editor.IntegrationTests.csproj">
<BuildType Solution="Proto|*" Project="Debug" />
</Project>
<Project Path="vsintegration/tests/FSharp.Editor.Apex.IntegrationTests/FSharp.Editor.Apex.IntegrationTests.csproj">
<BuildType Solution="Proto|*" Project="Debug" />
</Project>
<Project Path="vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj">
<BuildType Solution="Proto|*" Project="Debug" />
</Project>
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
<MicrosoftVisualStudioPlatformVSEditorVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioPlatformVSEditorVersion>
<MicrosoftVisualStudioTextUIWpfVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextUIWpfVersion>
<NuGetVisualStudioVersion>17.14.0</NuGetVisualStudioVersion>
<MicrosoftTestApexVisualStudioVersion>18.10.0-preview-1-12005-078</MicrosoftTestApexVisualStudioVersion>
<MSTestVersion>3.6.4</MSTestVersion>
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.800-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
<MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>$(MicrosoftVisualStudioExtensibilityTestingVersion)</MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
//
// Apex counterparts of the xUnit/IdeFact tests in
// vsintegration/tests/FSharp.Editor.IntegrationTests/CodeActionTests.cs. Each case sets up the same
// triggering F# source, places the caret where that test does, and verifies the same code/error fix
// is offered on the light bulb (asserting on the action's display text). The Apex light-bulb model
// exposes a flat action list, so the CodeFix/ErrorFix category asserted by the source tests is not
// mirrored here.

using FSharp.Editor.Apex.IntegrationTests.TestFramework;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FSharp.Editor.Apex.IntegrationTests
{
[TestClass]
public class CodeActionTests : FSharpLanguageServiceApexTest
{
protected override bool AutomaticallyDismissMessageBoxes => false;

[RetryTestMethod]
[Timeout(ShortTimeoutMS)]
[Description("Verify the 'Remove unused open declarations' code fix is offered on an unused open.")]
[Owner("fsharptools")]
[TestCategory("nightly"), TestCategory("Walkthrough")]
public void UnusedOpenDeclarations()
{
var code = @"module Library

open System

let x = 42";

this.AssertCodeActionOffered(code, "open System", "Remove unused open declarations");
}

[RetryTestMethod]
[Timeout(ShortTimeoutMS)]
[Description("Verify the 'Add missing 'fun' keyword' error fix is offered on a lambda missing 'fun'.")]
[Owner("fsharptools")]
[TestCategory("nightly"), TestCategory("Walkthrough")]
public void AddMissingFunKeyword()
{
var code = @"module Library

let original = []
let transformed = original |> List.map (x -> x)";

this.AssertCodeActionOffered(code, "->", "Add missing 'fun' keyword");
}

[RetryTestMethod]
[Timeout(ShortTimeoutMS)]
[Description("Verify the 'Add 'new' keyword' code fix is offered when constructing a disposable.")]
[Owner("fsharptools")]
[TestCategory("nightly"), TestCategory("Walkthrough")]
public void AddNewKeywordToDisposables()
{
var code = @"module Library

let sr = System.IO.StreamReader("""")";

this.AssertCodeActionOffered(code, "let sr", "Add 'new' keyword");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
//
// Ported verbatim from the TypeScript-VS repository
// (VS/LanguageService/Tests/Integration/CodeFixes/SuggestionCodeFix.cs) and then adjusted so that
// the setup is tailored for the F# extension. A single test case is kept, exercising an F# code fix
// (Wrap expression in parentheses, FS0597). The triggering code is taken from the F# code-fix unit
// tests: vsintegration/tests/FSharp.Editor.Tests/CodeFixes/WrapExpressionInParenthesesTests.fs.

using System;
using System.Linq;
using FSharp.Editor.Apex.IntegrationTests.TestFramework;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FSharp.Editor.Apex.IntegrationTests
{
[TestClass]
public class SuggestionCodeFix : FSharpLanguageServiceApexTest
{
#region Private members
protected override bool AutomaticallyDismissMessageBoxes => false;
private const string code = @"module Library

let rng = System.Random()

printfn ""Hello %d"" rng.Next(5)";
private const string expectedCode = @"module Library

let rng = System.Random()

printfn ""Hello %d"" (rng.Next(5))";
#endregion

[RetryTestMethod]
[Timeout(ShortTimeoutMS)]
[Description("Verify code-fix offers suggestion to wrap an expression in parentheses in an F# file.")]
[Owner("fsharptools")]
[TestCategory("nightly"), TestCategory("Walkthrough")]
public void SuggestionCodeFixInFSharpFile()
{
var document = this.OpenFSharpDocument(code, "rng.Next");

this.InvokeCodeFix(document, "rng.Next");
this.Library.Synchronization.WaitForSolutionCrawler();

this.Library.Synchronization.WaitFor(() => expectedCode == document.Contents, TimeSpan.FromSeconds(15));
}

#region Helps
public void InvokeCodeFix(TextDocumentView document, string expression)
{
var lightBulb = this.MoveToExpressionAndExpandLightBulb(document, expression);
var globalScopeAction = lightBulb.Actions.Single(action =>
action.Text.IndexOf("Wrap", StringComparison.OrdinalIgnoreCase) >= 0
);

globalScopeAction.Invoke();
}
#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">

<!--
Apex-based VS integration tests for the F# editor, ported from the TypeScript-VS repo.
These run out-of-process, driving a real Visual Studio instance via the Apex UI automation
framework (Microsoft.Test.Apex.VisualStudio) and MSTest, independently of the xUnit/IdeFact
integration tests in FSharp.Editor.IntegrationTests.
-->
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>disable</Nullable>
<OutputType>Library</OutputType>
<IsPackable>false</IsPackable>
<!-- Apex tests use MSTest, not the repo default xUnit3/MTP runner. -->
<ExcludeFromTestPackageReferences>true</ExcludeFromTestPackageReferences>
<NoWarn>$(NoWarn);CS1591;VSTHRD200</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- System.Web.Script.Serialization.JavaScriptSerializer, used to parse vswhere JSON output. -->
<Reference Include="System.Web.Extensions" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Test.Apex.VisualStudio" Version="$(MicrosoftTestApexVisualStudioVersion)" />
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
<!--
Resolves MSB3277: Microsoft.Test.Apex.VisualStudio references System.Diagnostics.DiagnosticSource
10.0.0.8, but the only copy in the package graph is 5.0.0 (pulled transitively via
MSTest -> Testing.Extensions.Telemetry -> ApplicationInsights). RAR cannot unify to a version
that is not present, so no binding redirect is generated and testhost would ship only v5.
Referencing 10.0.8 (assembly 10.0.0.8, matching Apex) makes it primary: the conflict is genuinely
resolved, a 5->10 redirect is generated, and the correct assembly is deployed. Version is pinned
explicitly (not the repo's 10.0.2) because it must match Apex's required 10.0.0.8.
-->
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="10.0.8" />
</ItemGroup>

</Project>
Loading