From f2a4b9dc8cb0c8bc0f5c48b2c94bf79a71f24c63 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 1 Mar 2026 13:49:50 +0000 Subject: [PATCH 1/2] Fix: respect IsTestProject MSBuild property in isTestProject check Replace the manual package-reference check (looking for Microsoft.TestPlatform.TestHost / Microsoft.NET.Test.Sdk) with project.Info.IsTestProject, which is the authoritative MSBuild value already computed by FsAutoComplete. Fixes #1970: users who set false in their project file to prevent a paket-shared project from appearing in Test Explorer were ignored because the old check only looked at package references. The MSBuild property IsTestProject is set to true by the Microsoft.NET.Test.Sdk targets whenever test SDK packages are present, so the new check is semantically equivalent for standard projects while also respecting explicit user overrides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Components/TestExplorer.fs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Components/TestExplorer.fs b/src/Components/TestExplorer.fs index a6bcafb7..329fc324 100644 --- a/src/Components/TestExplorer.fs +++ b/src/Components/TestExplorer.fs @@ -1126,11 +1126,12 @@ module ProjectExt = Project.getInWorkspace () |> List.map getPath let isTestProject (project: Project) = - let testProjectIndicators = - set [ "Microsoft.TestPlatform.TestHost"; "Microsoft.NET.Test.Sdk" ] - - project.PackageReferences - |> Array.exists (fun pr -> Set.contains pr.Name testProjectIndicators) + // Use the IsTestProject MSBuild property from FsAutoComplete. + // This respects explicit false overrides in project files + // (fixes #1970: paket-shared projects with test SDK packages incorrectly treated as test projects). + // The property is set to true by Microsoft.NET.Test.Sdk targets when test SDK packages are present, + // so this replaces the manual package-reference check with the authoritative MSBuild value. + project.Info.IsTestProject type CodeBasedTestId = TestId From fe8f22536e266a3b7f4b9f58ff03377266ba0f2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 1 Mar 2026 13:53:45 +0000 Subject: [PATCH 2/2] ci: trigger CI checks