From 0b781c1e735e6d7e9575c3fb354f6560ae88adf9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 30 Jun 2026 02:14:50 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[vstest]=20Source=20update=209f3151a=20?= =?UTF-8?q?=E2=86=92=20e683cdc=20Diff:=20https://github.com/microsoft/vste?= =?UTF-8?q?st/compare/9f3151a06cf9d1fbf36935698df7e9cb5d2f1e90..e683cdc0fa?= =?UTF-8?q?08b191c99cb8ab264295db837f2b6d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: https://github.com/microsoft/vstest/commit/9f3151a06cf9d1fbf36935698df7e9cb5d2f1e90 To: https://github.com/microsoft/vstest/commit/e683cdc0fa08b191c99cb8ab264295db837f2b6d [[ commit created by automation ]] --- src/source-manifest.json | 4 +- .../policies/PullRequestIssueManagement | 28 ----------- src/vstest/eng/Versions.props | 2 +- src/vstest/eng/common/build.ps1 | 6 ++- src/vstest/eng/common/build.sh | 6 ++- .../core-templates/steps/send-to-helix.yml | 22 ++++++++- src/vstest/eng/common/cross/build-rootfs.sh | 3 +- src/vstest/eng/common/cross/install-debs.py | 8 ++- src/vstest/eng/common/cross/toolchain.cmake | 16 +++--- src/vstest/eng/common/dotnet.ps1 | 1 + src/vstest/eng/common/msbuild.ps1 | 6 ++- src/vstest/eng/common/msbuild.sh | 6 ++- .../common/native/NativeAotSupported.props | 26 ++++++++++ src/vstest/eng/common/tools.ps1 | 4 +- src/vstest/eng/common/tools.sh | 7 ++- .../Execution/BaseRunTests.cs | 8 +-- .../Condition.cs | 49 ++++++++++--------- .../FilterExpression.cs | 8 +++ .../Hosting/DefaultTestHostManager.cs | 37 ++++++-------- .../Resources/Resources.Designer.cs | 9 ++++ .../Resources/Resources.resx | 5 ++ .../Resources/xlf/Resources.cs.xlf | 9 ++++ .../Resources/xlf/Resources.de.xlf | 9 ++++ .../Resources/xlf/Resources.es.xlf | 9 ++++ .../Resources/xlf/Resources.fr.xlf | 9 ++++ .../Resources/xlf/Resources.it.xlf | 9 ++++ .../Resources/xlf/Resources.ja.xlf | 9 ++++ .../Resources/xlf/Resources.ko.xlf | 9 ++++ .../Resources/xlf/Resources.pl.xlf | 9 ++++ .../Resources/xlf/Resources.pt-BR.xlf | 9 ++++ .../Resources/xlf/Resources.ru.xlf | 9 ++++ .../Resources/xlf/Resources.tr.xlf | 9 ++++ .../Resources/xlf/Resources.zh-Hans.xlf | 9 ++++ .../Resources/xlf/Resources.zh-Hant.xlf | 9 ++++ .../.runsettings | 3 -- .../ArgumentProcessorTests.cs | 7 +-- .../CreateNoNewWindowTests.cs | 6 +++ .../DataCollectionTests.cs | 4 +- .../DiscoveryTests.cs | 9 +--- .../DotnetTestMSBuildOutputTests.cs | 6 +-- .../ExecutionTests.cs | 24 ++++----- .../FilePatternParserTests.cs | 4 -- .../FrameworkTests.cs | 41 ++++++++++++++-- .../LoggerTests.cs | 22 +++------ .../MultitargetingTestHostTests.cs | 2 + .../PortableNugetPackageTests.cs | 2 - .../RecursiveResourcesLookupTests.cs | 3 +- .../ResultsDirectoryTests.cs | 2 - .../RunsettingsTests.cs | 2 - .../SerializationCompatibilityTests.cs | 4 ++ .../SerializerSelectionTests.cs | 3 ++ .../TelemetryTests.cs | 2 - .../TestCaseFilterTests.cs | 10 ---- .../.runsettings | 3 -- .../FilterSourceIntegrationTests.cs | 1 - .../CustomTestHostLauncherTests.cs | 2 + .../DataCollectorAttachmentProcessor.cs | 1 + .../DifferentTestFrameworkSimpleTests.cs | 5 +- .../TranslationLayerTests/DiscoverTests.cs | 5 +- .../LiveUnitTestingTests.cs | 2 + .../TranslationLayerTests/RunTests.cs | 8 +-- .../RunTestsWithFilterTests.cs | 1 + .../SerializeTestRunTests.cs | 5 -- .../TargetFrameworkTestHostDemultiplexer.cs | 5 -- .../Hosting/DefaultTestHostManagerTests.cs | 48 ++++++------------ .../AeDebuggerArgumentProcessorTest.cs | 1 + .../EnableBlameArgumentProcessorTests.cs | 2 - ...tnetVStestMessageArgumentProcessorTests.cs | 1 - 68 files changed, 389 insertions(+), 235 deletions(-) delete mode 100644 src/vstest/.github/policies/PullRequestIssueManagement create mode 100644 src/vstest/eng/common/native/NativeAotSupported.props diff --git a/src/source-manifest.json b/src/source-manifest.json index 74bcd897acb5..0d1dddb8c6f0 100644 --- a/src/source-manifest.json +++ b/src/source-manifest.json @@ -109,10 +109,10 @@ "commitSha": "f4059b7987c5ff3e4699805ca9e15e69f173e4da" }, { - "barId": 320500, + "barId": 320725, "path": "vstest", "remoteUri": "https://github.com/microsoft/vstest", - "commitSha": "9f3151a06cf9d1fbf36935698df7e9cb5d2f1e90" + "commitSha": "e683cdc0fa08b191c99cb8ab264295db837f2b6d" }, { "barId": 313700, diff --git a/src/vstest/.github/policies/PullRequestIssueManagement b/src/vstest/.github/policies/PullRequestIssueManagement deleted file mode 100644 index b8f34dbf727f..000000000000 --- a/src/vstest/.github/policies/PullRequestIssueManagement +++ /dev/null @@ -1,28 +0,0 @@ -id: -name: GitOps.PullRequestIssueManagement -description: GitOps.PullRequestIssueManagement primitive -owner: -resource: repository -disabled: false -where: -configuration: - resourceManagementConfiguration: - - eventResponderTasks: - - - description: Auto-approve maestro PRs - triggerOnOwnActions: false - if: - - payloadType: Pull_Request - - isPullRequest - - isActivitySender: - user: dotnet-maestro[bot] - issueAuthor: False - - isAction: - action: Opened - then: - - approvePullRequest: - comment: Auto-approve - -onFailure: -onSuccess: diff --git a/src/vstest/eng/Versions.props b/src/vstest/eng/Versions.props index a095b1129aed..1cd14ac9f850 100644 --- a/src/vstest/eng/Versions.props +++ b/src/vstest/eng/Versions.props @@ -14,7 +14,7 @@ from appending +, which breaks DTAAgent. --> false - 18.9.0 + 18.10.0 preview diff --git a/src/vstest/eng/common/build.ps1 b/src/vstest/eng/common/build.ps1 index 4b4f6b0923f2..2cbb725323e8 100644 --- a/src/vstest/eng/common/build.ps1 +++ b/src/vstest/eng/common/build.ps1 @@ -173,7 +173,11 @@ try { if (-not $excludeCIBinarylog) { $binaryLog = $true } - $nodeReuse = $false + # Disable node reuse on CI unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if ($env:MSBUILD_NODEREUSE_ENABLED -ne "1") { + $nodeReuse = $false + } } if (-not [string]::IsNullOrEmpty($binaryLogName)) { diff --git a/src/vstest/eng/common/build.sh b/src/vstest/eng/common/build.sh index 719ee4b58748..3a9fdcfd0f59 100755 --- a/src/vstest/eng/common/build.sh +++ b/src/vstest/eng/common/build.sh @@ -213,7 +213,11 @@ if [[ -z "$configuration" ]]; then fi if [[ "$ci" == true ]]; then - node_reuse=false + # Disable node reuse on CI unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if [[ "${MSBUILD_NODEREUSE_ENABLED:-}" != "1" ]]; then + node_reuse=false + fi if [[ "$exclude_ci_binary_log" == false ]]; then binary_log=true fi diff --git a/src/vstest/eng/common/core-templates/steps/send-to-helix.yml b/src/vstest/eng/common/core-templates/steps/send-to-helix.yml index 68fa739c4ab2..ec7a20003992 100644 --- a/src/vstest/eng/common/core-templates/steps/send-to-helix.yml +++ b/src/vstest/eng/common/core-templates/steps/send-to-helix.yml @@ -10,6 +10,7 @@ parameters: HelixConfiguration: '' # optional -- additional property attached to a job HelixPreCommands: '' # optional -- commands to run before Helix work item execution HelixPostCommands: '' # optional -- commands to run after Helix work item execution + UseHelixMonitor: false # optional -- true will submit Helix jobs configured for the standalone Helix Job Monitor (results are reported/waited on out-of-band; this step will not wait, and WaitForWorkItemCompletion will be overridden) WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects WorkItemTimeout: '' # optional -- a timeout in TimeSpan.Parse-ready value (e.g. 00:02:00) for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects @@ -31,7 +32,15 @@ parameters: continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false steps: - - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + - powershell: > + $(Build.SourcesDirectory)\eng\common\msbuild.ps1 + $(Build.SourcesDirectory)/${{ parameters.HelixProjectPath }} + /restore + /p:TreatWarningsAsErrors=false + /p:EnableHelixJobMonitor=${{ parameters.UseHelixMonitor }} + ${{ parameters.HelixProjectArguments }} + /t:Test + /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog displayName: ${{ parameters.DisplayNamePrefix }} (Windows) env: BuildConfig: $(_BuildConfig) @@ -61,7 +70,15 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + - script: > + $(Build.SourcesDirectory)/eng/common/msbuild.sh + $(Build.SourcesDirectory)/${{ parameters.HelixProjectPath }} + /restore + /p:TreatWarningsAsErrors=false + /p:EnableHelixJobMonitor=${{ parameters.UseHelixMonitor }} + ${{ parameters.HelixProjectArguments }} + /t:Test + /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog displayName: ${{ parameters.DisplayNamePrefix }} (Unix) env: BuildConfig: $(_BuildConfig) @@ -91,3 +108,4 @@ steps: SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} + diff --git a/src/vstest/eng/common/cross/build-rootfs.sh b/src/vstest/eng/common/cross/build-rootfs.sh index 273cae651a2b..3150ccac6fcd 100644 --- a/src/vstest/eng/common/cross/build-rootfs.sh +++ b/src/vstest/eng/common/cross/build-rootfs.sh @@ -88,8 +88,9 @@ __FreeBSDPackages+=" terminfo-db" __OpenBSDVersion="7.8" __OpenBSDPackages="heimdal-libs" __OpenBSDPackages+=" icu4c" -__OpenBSDPackages+=" inotify-tools" +__OpenBSDPackages+=" libinotify" __OpenBSDPackages+=" openssl" +__OpenBSDPackages+=" e2fsprogs" __IllumosPackages="icu" __IllumosPackages+=" mit-krb5" diff --git a/src/vstest/eng/common/cross/install-debs.py b/src/vstest/eng/common/cross/install-debs.py index 20ca770a1e21..1d1dfabf7dc9 100644 --- a/src/vstest/eng/common/cross/install-debs.py +++ b/src/vstest/eng/common/cross/install-debs.py @@ -121,10 +121,14 @@ async def fetch_release_file(session, mirror, suite, keyring): await download_file(session, release_gpg_url, release_gpg_file.name) print("Verifying signature of Release with Release.gpg.") - verify_command = ["gpg"] + # Use gpgv rather than gpg for verification. gpgv verifies a detached + # signature against a fixed keyring without involving gpg-agent or + # keyboxd, which makes it robust on hosts running GnuPG 2.4+ (e.g. Azure + # Linux) where "gpg --keyring" routes through keyboxd and can fail. + verify_command = ["gpgv"] if keyring: verify_command += ["--keyring", keyring] - verify_command += ["--verify", release_gpg_file.name, release_file.name] + verify_command += [release_gpg_file.name, release_file.name] result = subprocess.run(verify_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if result.returncode != 0: diff --git a/src/vstest/eng/common/cross/toolchain.cmake b/src/vstest/eng/common/cross/toolchain.cmake index 99d6dfe82dde..ead7fe3ef263 100644 --- a/src/vstest/eng/common/cross/toolchain.cmake +++ b/src/vstest/eng/common/cross/toolchain.cmake @@ -59,9 +59,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu") endif() elseif(FREEBSD) - set(triple "aarch64-unknown-freebsd12") + set(TOOLCHAIN "aarch64-unknown-freebsd14") elseif(OPENBSD) - set(triple "aarch64-unknown-openbsd") + set(TOOLCHAIN "aarch64-unknown-openbsd") endif() elseif(TARGET_ARCH_NAME STREQUAL "armel") set(CMAKE_SYSTEM_PROCESSOR armv7l) @@ -117,9 +117,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu") endif() elseif(FREEBSD) - set(triple "x86_64-unknown-freebsd12") + set(TOOLCHAIN "x86_64-unknown-freebsd14") elseif(OPENBSD) - set(triple "x86_64-unknown-openbsd") + set(TOOLCHAIN "x86_64-unknown-openbsd") elseif(ILLUMOS) set(TOOLCHAIN "x86_64-illumos") elseif(HAIKU) @@ -160,8 +160,6 @@ if(TIZEN) find_toolchain_dir("${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}") endif() - message(STATUS "TIZEN_TOOLCHAIN_PATH set to: ${TIZEN_TOOLCHAIN_PATH}") - include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++) include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++/${TIZEN_TOOLCHAIN}) endif() @@ -206,9 +204,9 @@ if(ANDROID) include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake) elseif(FREEBSD OR OPENBSD) # we cross-compile by instructing clang - set(CMAKE_C_COMPILER_TARGET ${triple}) - set(CMAKE_CXX_COMPILER_TARGET ${triple}) - set(CMAKE_ASM_COMPILER_TARGET ${triple}) + set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) + set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) + set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_SYSROOT "${CROSS_ROOTFS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld") diff --git a/src/vstest/eng/common/dotnet.ps1 b/src/vstest/eng/common/dotnet.ps1 index 45e5676c9ebd..ce4ea40730a0 100644 --- a/src/vstest/eng/common/dotnet.ps1 +++ b/src/vstest/eng/common/dotnet.ps1 @@ -8,4 +8,5 @@ $dotnetRoot = InitializeDotNetCli -install:$true if ($args.count -gt 0) { $env:DOTNET_NOLOGO=1 & "$dotnetRoot\dotnet.exe" $args + ExitWithExitCode $LASTEXITCODE } diff --git a/src/vstest/eng/common/msbuild.ps1 b/src/vstest/eng/common/msbuild.ps1 index f041e5ddd958..495d533a9098 100644 --- a/src/vstest/eng/common/msbuild.ps1 +++ b/src/vstest/eng/common/msbuild.ps1 @@ -14,7 +14,11 @@ Param( try { if ($ci) { - $nodeReuse = $false + # Disable node reuse on CI unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if ($env:MSBUILD_NODEREUSE_ENABLED -ne "1") { + $nodeReuse = $false + } } MSBuild @extraArgs diff --git a/src/vstest/eng/common/msbuild.sh b/src/vstest/eng/common/msbuild.sh index 20d3dad54352..333be3232fcf 100644 --- a/src/vstest/eng/common/msbuild.sh +++ b/src/vstest/eng/common/msbuild.sh @@ -51,7 +51,11 @@ done . "$scriptroot/tools.sh" if [[ "$ci" == true ]]; then - node_reuse=false + # Disable node reuse on CI unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if [[ "${MSBUILD_NODEREUSE_ENABLED:-}" != "1" ]]; then + node_reuse=false + fi fi MSBuild $extra_args diff --git a/src/vstest/eng/common/native/NativeAotSupported.props b/src/vstest/eng/common/native/NativeAotSupported.props new file mode 100644 index 000000000000..559a6663929e --- /dev/null +++ b/src/vstest/eng/common/native/NativeAotSupported.props @@ -0,0 +1,26 @@ + + + + + <_NativeAotSupportedOS Condition=" + '$(TargetOS)' != 'browser' and + '$(TargetOS)' != 'haiku' and + '$(TargetOS)' != 'illumos' and + '$(TargetOS)' != 'netbsd' and + '$(TargetOS)' != 'solaris' + ">true + + + <_NativeAotSupportedArch Condition=" + '$(TargetArchitecture)' != 'wasm' and + ('$(TargetArchitecture)' != 'x86' or '$(TargetOS)' == 'windows') + ">true + + true + + + diff --git a/src/vstest/eng/common/tools.ps1 b/src/vstest/eng/common/tools.ps1 index fc72fe63049d..de32a6da3770 100644 --- a/src/vstest/eng/common/tools.ps1 +++ b/src/vstest/eng/common/tools.ps1 @@ -742,7 +742,9 @@ function MSBuild() { ExitWithExitCode 1 } - if ($nodeReuse) { + # Node reuse must be disabled in CI builds unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if ($nodeReuse -and $env:MSBUILD_NODEREUSE_ENABLED -ne "1") { Write-PipelineTelemetryError -Category 'Build' -Message 'Node reuse must be disabled in CI build.' ExitWithExitCode 1 } diff --git a/src/vstest/eng/common/tools.sh b/src/vstest/eng/common/tools.sh index 48cab70ebf4b..69ca926a6a87 100755 --- a/src/vstest/eng/common/tools.sh +++ b/src/vstest/eng/common/tools.sh @@ -466,7 +466,8 @@ function ExitWithExitCode { function StopProcesses { echo "Killing running build processes..." pkill -9 "dotnet" || true - pkill -9 "vbcscompiler" || true + pkill -9 -i -x VBCSCompiler || true + pkill -9 -i -x MSBuild || true return 0 } @@ -497,7 +498,9 @@ function MSBuild { ExitWithExitCode 1 fi - if [[ "$node_reuse" == true ]]; then + # Node reuse must be disabled in CI builds unless explicitly opted in via MSBUILD_NODEREUSE_ENABLED. + # Internal testing only; this env var will be replaced with a switch (https://github.com/dotnet/arcade/issues/17013) and must not be depended on. + if [[ "$node_reuse" == true && "${MSBUILD_NODEREUSE_ENABLED:-}" != "1" ]]; then Write-PipelineTelemetryError -category 'Build' "Node reuse must be disabled in CI build." ExitWithExitCode 1 fi diff --git a/src/vstest/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs b/src/vstest/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs index 9e640745d750..552f082dad07 100644 --- a/src/vstest/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs +++ b/src/vstest/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs @@ -223,9 +223,11 @@ public void RunTests() // instantiated via reflection and its constructor throws. Unwrap that wrapper to the // real exception so callers don't see the reflection noise. Any other exception is // preserved as-is so its concrete type and stack trace are not lost on the way out. - Exception realException = ex is TargetInvocationException tie && tie.InnerException is not null - ? tie.InnerException - : ex; + Exception realException = ex switch + { + TargetInvocationException { InnerException: { } inner } => inner, + _ => ex, + }; exception = new Exception(realException.Message, realException); isAborted = true; } diff --git a/src/vstest/src/Microsoft.TestPlatform.Filter.Source/Condition.cs b/src/vstest/src/Microsoft.TestPlatform.Filter.Source/Condition.cs index 12b05562737e..ad5ddb37eb50 100644 --- a/src/vstest/src/Microsoft.TestPlatform.Filter.Source/Condition.cs +++ b/src/vstest/src/Microsoft.TestPlatform.Filter.Source/Condition.cs @@ -157,8 +157,32 @@ internal bool Evaluate(Func propertyValueProvider) #if IS_VSTEST_REPO ValidateArg.NotNull(propertyValueProvider, nameof(propertyValueProvider)); #endif - var multiValue = GetPropertyValue(propertyValueProvider); - var result = Operation switch + var propertyValue = propertyValueProvider(Name); + + // Fast path: single string value (most common case for FullyQualifiedName, DisplayName, etc.) + // Avoids allocating a string[1] wrapper that the general multi-value path would create. + if (propertyValue is string singleValue) + { + return Operation switch + { + Operation.Equal => string.Equals(singleValue, Value, StringComparison.OrdinalIgnoreCase), + Operation.NotEqual => !string.Equals(singleValue, Value, StringComparison.OrdinalIgnoreCase), + Operation.Contains => singleValue.IndexOf(Value, StringComparison.OrdinalIgnoreCase) != -1, + Operation.NotContains => singleValue.IndexOf(Value, StringComparison.OrdinalIgnoreCase) == -1, + _ => false, + }; + } + + // Null, string[], or other types: use multi-value evaluation. + // Other types are coerced via ToString() for backward compatibility. + string[]? multiValue = propertyValue switch + { + null => null, + string[] arr => arr, + _ => new[] { propertyValue.ToString()! }, + }; + + return Operation switch { // if any value in multi-valued property matches 'this.Value', for Equal to evaluate true. Operation.Equal => EvaluateEqualOperation(multiValue), @@ -170,8 +194,6 @@ internal bool Evaluate(Func propertyValueProvider) Operation.NotContains => !EvaluateContainsOperation(multiValue), _ => false, }; - - return result; } /// @@ -292,25 +314,6 @@ private static Operation GetOperator(string operationString) }; } - /// - /// Returns property value for Property using propertValueProvider. - /// - private string[]? GetPropertyValue(Func propertyValueProvider) - { - var propertyValue = propertyValueProvider(Name); - if (null != propertyValue) - { - if (propertyValue is not string[] multiValue) - { - multiValue = new string[1]; - multiValue[0] = propertyValue.ToString()!; - } - return multiValue; - } - - return null; - } - internal static IEnumerable TokenizeFilterConditionString(string str) { return str == null ? throw new ArgumentNullException(nameof(str)) : TokenizeFilterConditionStringWorker(str); diff --git a/src/vstest/src/Microsoft.TestPlatform.Filter.Source/FilterExpression.cs b/src/vstest/src/Microsoft.TestPlatform.Filter.Source/FilterExpression.cs index a80780064fd7..507f12743604 100644 --- a/src/vstest/src/Microsoft.TestPlatform.Filter.Source/FilterExpression.cs +++ b/src/vstest/src/Microsoft.TestPlatform.Filter.Source/FilterExpression.cs @@ -384,6 +384,14 @@ internal bool Evaluate(Func propertyValueProvider) ValidateArg.NotNull(propertyValueProvider, nameof(propertyValueProvider)); #endif + // Fast path: leaf node (single condition, no sub-expressions). + // Avoids allocating two Stack objects and a lambda for the common + // single-condition filter case (e.g. "FullyQualifiedName~Test"). + if (_condition is not null) + { + return _condition.Evaluate(propertyValueProvider); + } + return IterateFilterExpression((current, result) => { // Only the leaves have a condition value. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs index 87a84e36d7a1..0452489908dc 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs @@ -56,7 +56,6 @@ public class DefaultTestHostManager : ITestRuntimeProvider2 private readonly IProcessHelper _processHelper; private readonly IFileHelper _fileHelper; private readonly IEnvironment _environment; - private readonly IDotnetHostHelper _dotnetHostHelper; private readonly IEnvironmentVariableHelper _environmentVariableHelper; private bool _disableAppDomain; private Architecture _architecture; @@ -78,7 +77,6 @@ public DefaultTestHostManager() : this( new ProcessHelper(), new FileHelper(), - new DotnetHostHelper(), new PlatformEnvironment(), new EnvironmentVariableHelper()) { @@ -91,17 +89,14 @@ public DefaultTestHostManager() /// File helper instance. /// Instance of platform environment. /// The environment helper. - /// Instance of dotnet host helper. internal DefaultTestHostManager( IProcessHelper processHelper, IFileHelper fileHelper, - IDotnetHostHelper dotnetHostHelper, IEnvironment environment, IEnvironmentVariableHelper environmentVariableHelper) { _processHelper = processHelper; _fileHelper = fileHelper; - _dotnetHostHelper = dotnetHostHelper; _environment = environment; _environmentVariableHelper = environmentVariableHelper; } @@ -210,28 +205,26 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo( EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Trying to use {0} from {1}", originalTestHostProcessName, testhostProcessPath); + // .NET Framework tests run through testhost.exe, which can only run on Windows. + // Running them on other operating systems previously relied on Mono, which is no + // longer supported. Fail with a clear message instead of launching Mono. + if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows)) + { + throw new TestPlatformException(Resources.NetFrameworkTestsNotSupportedOnNonWindows); + } + var launcherPath = testhostProcessPath; var processName = _processHelper.GetCurrentProcessFileName(); if (processName is not null) { - if (!_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows) - && !processName.EndsWith(DotnetHostHelper.MONOEXENAME, StringComparison.OrdinalIgnoreCase)) - { - launcherPath = _dotnetHostHelper.GetMonoPath(); - argumentsString = testhostProcessPath.AddDoubleQuote() + " " + argumentsString; - } - else + // Patching the relative path for IDE scenarios. + if (!(processName.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase) + || processName.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)) + && !File.Exists(testhostProcessPath)) { - // Patching the relative path for IDE scenarios. - if (_environment.OperatingSystem.Equals(PlatformOperatingSystem.Windows) - && !(processName.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase) - || processName.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)) - && !File.Exists(testhostProcessPath)) - { - testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName); - EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Could not find {0} in previous location, now using {1}", originalTestHostProcessName, testhostProcessPath); - launcherPath = testhostProcessPath; - } + testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName); + EqtTrace.Verbose("DefaultTestHostmanager.GetTestHostProcessStartInfo: Could not find {0} in previous location, now using {1}", originalTestHostProcessName, testhostProcessPath); + launcherPath = testhostProcessPath; } } diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.Designer.cs b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.Designer.cs index 4b3c61266601..98248f73dd78 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.Designer.cs +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.Designer.cs @@ -111,5 +111,14 @@ internal static string NoDotnetMuxerFoundForArchitecture } } + /// + /// Looks up a localized string similar to Running .NET Framework tests is supported on Windows only.. + /// + internal static string NetFrameworkTestsNotSupportedOnNonWindows { + get { + return ResourceManager.GetString("NetFrameworkTestsNotSupportedOnNonWindows", resourceCulture); + } + } + } } diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.resx b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.resx index a5850f83c6c4..9aafbc4edad4 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.resx +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/Resources.resx @@ -147,4 +147,9 @@ The specified framework can be found at: '{0}' is the placeholder for 'dotnet.exe' or 'dotnet' value and depends on platform Windows/Unix, '{1}' is the placeholder for the architeture name like ARM64, X64 etc... + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + \ No newline at end of file diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.cs.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.cs.xlf index 1246ba96dfa6..8fe92b0e8ab5 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.cs.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.cs.xlf @@ -26,6 +26,15 @@ Ověřte, že: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Nejde najít {0}. Ujistěte se, že testovací projekt má odkaz na balíček nuget Microsoft.NET.Test.Sdk. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.de.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.de.xlf index 8333c34568b6..a4a148e62173 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.de.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.de.xlf @@ -26,6 +26,15 @@ Bestätigen Sie, dass: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". "{0}" wurde nicht gefunden. Stellen Sie sicher, dass das Testprojekt einen NuGet-Verweis des Pakets "Microsoft.NET.Test.Sdk" aufweist. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.es.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.es.xlf index 44c79eb54f25..9f44a85e4115 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.es.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.es.xlf @@ -26,6 +26,15 @@ Compruebe que: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". No se encuentra {0}. Asegúrese de que el proyecto de prueba tenga una referencia NuGet del paquete "Microsoft.NET.Test.Sdk". diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.fr.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.fr.xlf index 01c65b16c69a..8027a007c6e4 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.fr.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.fr.xlf @@ -26,6 +26,15 @@ Vérifiez ce qui suit : {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". {0} est introuvable. Vérifiez que le projet de test a une référence nuget du package "Microsoft.NET.Test.Sdk". diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.it.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.it.xlf index 2a27a568f099..cc456effc706 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.it.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.it.xlf @@ -26,6 +26,15 @@ Verificare che: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Non è possibile trovare {0}. Assicurarsi che il progetto di test includa un riferimento NuGet del pacchetto "Microsoft.NET.Test.Sdk". diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ja.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ja.xlf index 09a00dd6540b..19326baa581e 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ja.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ja.xlf @@ -26,6 +26,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". {0} を見つけることができません。テスト プロジェクトにパッケージ "Microsoft.NET.Test.Sdk" の NuGet 参照があることを確認してください。 diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ko.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ko.xlf index 88773a578465..5818e27d28e0 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ko.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ko.xlf @@ -26,6 +26,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". {0}을(를) 찾을 수 없습니다. 테스트 프로젝트에 "Microsoft.NET.Test.Sdk" 패키지의 nuget 참조가 포함되어 있는지 확인하세요. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pl.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pl.xlf index 4959e232cac9..0376620b20f1 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pl.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pl.xlf @@ -26,6 +26,15 @@ Sprawdź, czy: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Nie można znaleźć elementu {0}. Upewnij się, że projekt testowy ma odwołanie nuget do pakietu „Microsoft.NET.Test.Sdk”. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pt-BR.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pt-BR.xlf index 5a61e3e93405..a2a8567eeb98 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pt-BR.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.pt-BR.xlf @@ -26,6 +26,15 @@ Verifique se: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Não foi possível localizar {0}. Certifique-se de que o projeto de teste tem uma referência nuget do pacote "Microsoft.NET.Test.Sdk". diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ru.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ru.xlf index 4262a63f6f06..eccc6af28774 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ru.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.ru.xlf @@ -26,6 +26,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". Не удается найти {0}. Убедитесь, что в тестовом проекте есть ссылка NuGet на пакет "Microsoft.NET.Test.Sdk". diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.tr.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.tr.xlf index 8372c3a1a0bf..daef6fcd2b5d 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.tr.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.tr.xlf @@ -26,6 +26,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". {0} bulunamıyor. Test projesinin "Microsoft.NET.Test.Sdk" paketinde nuget başvurusu olduğundan emin olun. diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hans.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hans.xlf index 6aced291ad3f..fde22fbdda17 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hans.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hans.xlf @@ -26,6 +26,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". 无法找到 {0}。确保测试项目具有包 "Microsoft.NET.Test.Sdk" 的 nuget 引用。 diff --git a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hant.xlf b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hant.xlf index 9cdad4d9b66f..d9bf964ed0c2 100644 --- a/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hant.xlf +++ b/src/vstest/src/Microsoft.TestPlatform.TestHostProvider/Resources/xlf/Resources.zh-Hant.xlf @@ -27,6 +27,15 @@ Verify that: {0} + + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + Running .NET Framework tests is supported on Windows only. + +Running .NET Framework tests on this operating system relied on Mono, which is no longer supported. To run these tests, run them on Windows, or change the test project to target .NET instead of .NET Framework. + + Unable to find {0}. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk". 找不到 {0}。請確認測試專案有 "Microsoft.NET.Test.Sdk "套件的 nuget 參考。 diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/.runsettings b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/.runsettings index 823b5bb2d550..cd8b6eb4daa3 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/.runsettings +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/.runsettings @@ -1,5 +1,2 @@ - - true - \ No newline at end of file diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ArgumentProcessorTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ArgumentProcessorTests.cs index 0f296846c505..8f2fe25d03cc 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ArgumentProcessorTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ArgumentProcessorTests.cs @@ -7,13 +7,11 @@ namespace Microsoft.TestPlatform.AcceptanceTests; [TestClass] -[TestCategory("Windows-Review")] public class ArgumentProcessorTests : AcceptanceTestBase { [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void PassingNoArgumentsToVsTestConsoleShouldPrintHelpMessage(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -34,8 +32,7 @@ public void PassingNoArgumentsToVsTestConsoleShouldPrintHelpMessage(RunnerInfo r } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void PassingInvalidArgumentsToVsTestConsoleShouldNotPrintHelpMessage(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CreateNoNewWindowTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CreateNoNewWindowTests.cs index f7acd3b94a46..5122bec933f8 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CreateNoNewWindowTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CreateNoNewWindowTests.cs @@ -12,6 +12,8 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class CreateNoNewWindowTests : AcceptanceTestBase { [TestMethod] + // CreateNoNewWindow maps to the Windows-only process CreateNoWindow flag and only runs on the .NET Framework testhost. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: false)] public void WhenCreateNoNewWindowIsFalse_DiagShowsCreateNoWindowFalse(RunnerInfo runnerInfo) { @@ -34,6 +36,8 @@ public void WhenCreateNoNewWindowIsFalse_DiagShowsCreateNoWindowFalse(RunnerInfo } [TestMethod] + // CreateNoNewWindow maps to the Windows-only process CreateNoWindow flag and only runs on the .NET Framework testhost. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: false)] public void WhenCreateNoNewWindowIsTrue_DiagShowsCreateNoWindowTrue(RunnerInfo runnerInfo) { @@ -56,6 +60,8 @@ public void WhenCreateNoNewWindowIsTrue_DiagShowsCreateNoWindowTrue(RunnerInfo r } [TestMethod] + // CreateNoNewWindow maps to the Windows-only process CreateNoWindow flag and only runs on the .NET Framework testhost. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: false)] public void WhenCreateNoNewWindowIsNotSet_DefaultIsTrue(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DataCollectionTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DataCollectionTests.cs index 26e068f9cb02..af0b35edcc27 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DataCollectionTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DataCollectionTests.cs @@ -20,7 +20,6 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class DataCollectionTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void ExecuteTestsWithDataCollection(RunnerInfo runnerInfo) { @@ -44,7 +43,6 @@ public void ExecuteTestsWithDataCollection(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void ExecuteTestsWithDataCollectionUsingCollectArgument(RunnerInfo runnerInfo) { @@ -80,6 +78,7 @@ public void DataCollectorAssemblyLoadingShouldNotThrowErrorForNetCore(RunnerInfo } [TestMethod] + // .NET Framework testhost-specific assembly loading; not applicable to the netcore testhost. [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] public void DataCollectorAssemblyLoadingShouldNotThrowErrorForFullFramework(RunnerInfo runnerInfo) @@ -93,7 +92,6 @@ public void DataCollectorAssemblyLoadingShouldNotThrowErrorForFullFramework(Runn } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void DataCollectorAttachmentProcessor(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DiscoveryTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DiscoveryTests.cs index 3680b3c9bca2..23d047a76fff 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DiscoveryTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DiscoveryTests.cs @@ -18,7 +18,6 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class DiscoveryTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void DiscoverAllTests(RunnerInfo runnerInfo) { @@ -32,7 +31,6 @@ public void DiscoverAllTests(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true, useVsixRunner: true)] [NetCoreTargetFrameworkDataSource] [TestCategory("Smoke")] public void MultipleSourcesDiscoverAllTests(RunnerInfo runnerInfo) @@ -55,8 +53,7 @@ public void MultipleSourcesDiscoverAllTests(RunnerInfo runnerInfo) } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void DiscoverFullyQualifiedTests(RunnerInfo runnerInfo) { var dummyFilePath = Path.Combine(TempDirectory.Path, $"{Guid.NewGuid()}.txt"); @@ -74,7 +71,6 @@ public void DiscoverFullyQualifiedTests(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void DiscoverTestsShouldShowProperWarningIfNoTestsOnTestCaseFilter(RunnerInfo runnerInfo) { @@ -119,8 +115,7 @@ public void TypesToLoadAttributeTests() } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void DiscoverTestsShouldSucceedWhenAtLeastOneDllFindsRuntimeProvider(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestMSBuildOutputTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestMSBuildOutputTests.cs index 64634bde4731..7602917081ab 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestMSBuildOutputTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestMSBuildOutputTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class DotnetTestMSBuildOutputTests : AcceptanceTestBase { [TestMethod] - // patched dotnet is not published on non-windows systems + // Special characters (~, !, |, %) don't survive the MSBuildLogger output round-trip on non-Windows terminals. [TestCategory("Windows-Review")] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void MSBuildLoggerCanBeEnabledByBuildPropertyAndDoesNotEatSpecialChars(RunnerInfo runnerInfo) @@ -54,8 +54,6 @@ public void MSBuildLoggerCanBeEnabledByBuildPropertyAndDoesNotEatSpecialChars(Ru } [TestMethod] - // patched dotnet is not published on non-windows systems - [TestCategory("Windows-Review")] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void MSBuildLoggerCanBeDisabledByBuildProperty(RunnerInfo runnerInfo) { @@ -74,8 +72,6 @@ public void MSBuildLoggerCanBeDisabledByBuildProperty(RunnerInfo runnerInfo) [TestMethod] - // patched dotnet is not published on non-windows systems - [TestCategory("Windows-Review")] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void MSBuildLoggerCanBeDisabledByEnvironmentVariableProperty(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs index 4fd4b85bb423..920a1c7f9b39 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs @@ -16,8 +16,8 @@ namespace Microsoft.TestPlatform.AcceptanceTests; [TestClass] public class ExecutionTests : AcceptanceTestBase { - //TODO: It looks like the first 3 tests would be useful to multiply by all 3 test frameworks, should we make the test even more generic, or duplicate them? [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [MSTestCompatibilityDataSource] public void RunMultipleTestAssemblies(RunnerInfo runnerInfo) @@ -35,6 +35,7 @@ public void RunMultipleTestAssemblies(RunnerInfo runnerInfo) } [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [TestHostCompatibilityDataSource] public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations(RunnerInfo runnerInfo) @@ -52,6 +53,7 @@ public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations(Ru } [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [RunnerCompatibilityDataSource] public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations2(RunnerInfo runnerInfo) @@ -67,9 +69,7 @@ public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations2(R } [TestMethod] - [TestCategory("Windows-Review")] [TestCategory("Smoke")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true, useVsixRunner: true)] [NetCoreTargetFrameworkDataSource] public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations3(RunnerInfo runnerInfo) { @@ -87,7 +87,6 @@ public void RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations3(R // the two respective versions together (e.g. latest xunit and latest mstest), but does using two different test // frameworks have any added value over using 2 mstest dlls? [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunMultipleTestAssembliesWithoutTestAdapterPath(RunnerInfo runnerInfo) { @@ -134,7 +133,6 @@ public void RunMultipleTestAssembliesInParallel(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void TestSessionTimeOutTests(RunnerInfo runnerInfo) { @@ -156,7 +154,6 @@ public void TestSessionTimeOutTests(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void WorkingDirectoryIsSourceDirectory(RunnerInfo runnerInfo) { @@ -173,6 +170,9 @@ public void WorkingDirectoryIsSourceDirectory(RunnerInfo runnerInfo) } [TestMethod] + // Asserts the testhost-specific stack overflow message; the .NET Framework variant requires the + // .NET Framework testhost, which is only available on Windows. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void StackOverflowExceptionShouldBeLoggedToConsoleAndDiagLogFile(RunnerInfo runnerInfo) @@ -198,6 +198,9 @@ public void StackOverflowExceptionShouldBeLoggedToConsoleAndDiagLogFile(RunnerIn } [TestMethod] + // Asserts the testhost-specific unhandled exception message; the .NET Framework variant requires the + // .NET Framework testhost, which is only available on Windows. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void UnhandleExceptionExceptionShouldBeLoggedToDiagLogFile(RunnerInfo runnerInfo) @@ -292,8 +295,7 @@ public void IncompatibleSourcesWarningShouldBeDisplayedInTheConsoleOnlyWhenRunni } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void ExitCodeShouldReturnOneWhenTreatNoTestsAsErrorParameterSetToTrueAndNoTestMatchesFilter(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -312,8 +314,7 @@ public void ExitCodeShouldReturnOneWhenTreatNoTestsAsErrorParameterSetToTrueAndN } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void ExitCodeShouldReturnZeroWhenTreatNoTestsAsErrorParameterSetToFalseAndNoTestMatchesFilter(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -366,8 +367,7 @@ public void ExitCodeShouldNotDependOnFailTreatNoTestsAsErrorFalseValueWhenThereA } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void ExecuteTestsShouldSucceedWhenAtLeastOneDllFindsRuntimeProvider(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FilePatternParserTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FilePatternParserTests.cs index 7eddb74cc222..4365382eb321 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FilePatternParserTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FilePatternParserTests.cs @@ -12,7 +12,6 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class FilePatternParserTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void WildCardPatternShouldCorrectlyWorkOnFiles(RunnerInfo runnerInfo) { @@ -32,7 +31,6 @@ public void WildCardPatternShouldCorrectlyWorkOnFiles(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void WildCardPatternShouldCorrectlyWorkOnArbitraryDepthDirectories(RunnerInfo runnerInfo) { @@ -58,7 +56,6 @@ public void WildCardPatternShouldCorrectlyWorkOnArbitraryDepthDirectories(Runner } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void WildCardPatternShouldCorrectlyWorkForRelativeAssemblyPath(RunnerInfo runnerInfo) { @@ -84,7 +81,6 @@ public void WildCardPatternShouldCorrectlyWorkForRelativeAssemblyPath(RunnerInfo } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void WildCardPatternShouldCorrectlyWorkOnMultipleFiles(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FrameworkTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FrameworkTests.cs index c08561abe9d2..12b9f7f67688 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FrameworkTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/FrameworkTests.cs @@ -13,7 +13,6 @@ public class FrameworkTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void FrameworkArgumentShouldWork(RunnerInfo runnerInfo) { @@ -27,7 +26,6 @@ public void FrameworkArgumentShouldWork(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void FrameworkShortNameArgumentShouldWork(RunnerInfo runnerInfo) { @@ -69,6 +67,7 @@ public void OnWrongFrameworkPassedTestRunShouldNotRun(RunnerInfo runnerInfo) [TestMethod] [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] + // The .NET (Core) runner produces a different framework-incompatible warning on non-Windows, so keep this Windows-only. [TestCategory("Windows-Review")] public void RunSpecificTestsShouldWorkWithFrameworkInCompatibleWarning(RunnerInfo runnerInfo) { @@ -87,10 +86,14 @@ public void RunSpecificTestsShouldWorkWithFrameworkInCompatibleWarning(RunnerInf // but the settings requested .NET Framework 4.0. The test will still run because .NET Framework is compatible, and in reality // the system has .NET Framework 481 or newer installed, which runs even if we ask for .NET Framework 4.0 testhost. // - // On Linux and Mac we execute only net11.0 tests, and even though we force .NET Framework, we end up running on mono - // which is suprisingly able to run the .NET CoreApp dll, so we still just see a warning and 1 completed test. + // This test is Windows-Review only, so it does not run on Linux or Mac in CI. If it is run there manually, + // forcing .NET Framework now fails fast, because the .NET Framework test host is no longer launched through Mono. var isWindows = Environment.OSVersion.Platform.ToString().StartsWith("Win"); - if (runnerInfo.TargetFramework.Contains("net11") && isWindows) + if (!isWindows) + { + StdErrorContains("Running .NET Framework tests is supported on Windows only"); + } + else if (runnerInfo.TargetFramework.Contains("net11")) { StdOutputContains("No test is available"); } @@ -100,4 +103,32 @@ public void RunSpecificTestsShouldWorkWithFrameworkInCompatibleWarning(RunnerInf ValidateSummaryStatus(1, 0, 0); } } + + [TestMethod] + [NetCoreTargetFrameworkDataSource] + public void RunningNetFrameworkTestsOnNonWindowsShouldFailWithClearError(RunnerInfo runnerInfo) + { + SetTestEnvironment(_testEnvironment, runnerInfo); + + // Force the run to use the .NET Framework test host (testhost.exe). That host exists only on + // Windows. On other operating systems we used to fall back to Mono, which is no longer supported, + // so the run should fail fast with a clear, actionable message instead of an opaque Mono error. + var arguments = PrepareArguments(GetSampleTestAssembly(), string.Empty, string.Empty, string.Empty, resultsDirectory: TempDirectory.Path); + arguments = string.Concat(arguments, " ", "/Framework:Framework40"); + + InvokeVsTest(arguments); + + var isWindows = Environment.OSVersion.Platform.ToString().StartsWith("Win"); + if (isWindows) + { + // On Windows the .NET Framework test host is available, so the "Windows only" error must not appear. + StdErrorDoesNotContains("Running .NET Framework tests is supported on Windows only"); + } + else + { + // The run must fail fast with a clear message, not merely log a warning. + StdErrorContains("Running .NET Framework tests is supported on Windows only"); + ExitCodeEquals(1); + } + } } diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/LoggerTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/LoggerTests.cs index 19229373719b..86717def0979 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/LoggerTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/LoggerTests.cs @@ -16,8 +16,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class LoggerTests : AcceptanceTestBase { [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void TrxLoggerWithFriendlyNameShouldProperlyOverwriteFile(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -37,8 +36,7 @@ public void TrxLoggerWithFriendlyNameShouldProperlyOverwriteFile(RunnerInfo runn } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void HtmlLoggerWithFriendlyNameShouldProperlyOverwriteFile(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -58,8 +56,7 @@ public void HtmlLoggerWithFriendlyNameShouldProperlyOverwriteFile(RunnerInfo run } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void HtmlLoggerWithFriendlyNameContainsExpectedContent(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -106,8 +103,7 @@ public void TrxLoggerWithExecutorUriShouldProperlyOverwriteFile(RunnerInfo runne } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] + [NetCoreTargetFrameworkDataSource] public void TrxLoggerWithLogFilePrefixShouldGenerateMultipleTrx(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -147,8 +143,7 @@ public void HtmlLoggerWithExecutorUriShouldProperlyOverwriteFile(RunnerInfo runn } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void TrxLoggerResultSummaryOutcomeValueShouldBeFailedIfNoTestsExecutedAndTreatNoTestsAsErrorIsTrue(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -170,8 +165,7 @@ public void TrxLoggerResultSummaryOutcomeValueShouldBeFailedIfNoTestsExecutedAnd } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void TrxLoggerResultSummaryOutcomeValueShouldNotChangeIfNoTestsExecutedAndTreatNoTestsAsErrorIsFalse(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -193,7 +187,6 @@ public void TrxLoggerResultSummaryOutcomeValueShouldNotChangeIfNoTestsExecutedAn } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TrxLoggerResultSummaryOutcomeValueShouldBeFailedWhenDataCollectorLogsError(RunnerInfo runnerInfo) { @@ -222,7 +215,6 @@ public void TrxLoggerResultSummaryOutcomeValueShouldBeFailedWhenDataCollectorLog } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TrxLoggerResultSummaryOutcomeValueShouldBeCompletedWhenDataCollectorLogsErrorAndTreatErrorMessagesAsWarningsIsTrue(RunnerInfo runnerInfo) { @@ -315,7 +307,6 @@ private static void IsFileAndContentEqual(string filePath) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TrxLoggerShouldNotDoubleCountDataDrivenTestResults(RunnerInfo runnerInfo) { @@ -347,7 +338,6 @@ public void TrxLoggerShouldNotDoubleCountDataDrivenTestResults(RunnerInfo runner } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TrxLoggerShouldPlaceTrxFileInSubdirectoryWhenLogFileNameContainsPath(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/MultitargetingTestHostTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/MultitargetingTestHostTests.cs index 4731d3586add..163238e7831c 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/MultitargetingTestHostTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/MultitargetingTestHostTests.cs @@ -12,6 +12,8 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class MultitargetingTestHostTests : AcceptanceTestBase { [TestMethod] + // Multitargeting is exercised against .NET Framework testhosts (net481), which only exist on Windows, + // so both data sources produce zero rows on Linux/macOS. [TestCategory("Windows-Review")] // the underlying test is using xUnit to avoid AppDomain enhancements in MSTest that make this pass even without multitargetting // xUnit supports net452 onwards, so that is why this starts at net452, I also don't test all framework versions diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/PortableNugetPackageTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/PortableNugetPackageTests.cs index 1e8006421e0f..1b42e0b8f011 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/PortableNugetPackageTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/PortableNugetPackageTests.cs @@ -24,7 +24,6 @@ public static void ClassInit(TestContext _) } [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunMultipleTestAssemblies(RunnerInfo runnerInfo) { @@ -39,7 +38,6 @@ public void RunMultipleTestAssemblies(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void DiscoverAllTests(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RecursiveResourcesLookupTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RecursiveResourcesLookupTests.cs index d5fcc7756b07..6bdf038ef84c 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RecursiveResourcesLookupTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RecursiveResourcesLookupTests.cs @@ -11,7 +11,8 @@ public class RecursiveResourcesLookupTests : AcceptanceTestBase { [TestMethod] // This only fails on .NET Framework, and it fails in testhost, so no need to double check with - // two different runners. + // two different runners. The NetFull data source is empty on Linux/macOS. + [TestCategory("Windows-Review")] [Ignore("Temporarily ignore until solving https://github.com/microsoft/testfx/issues/2692")] [NetFullTargetFrameworkDataSource(useCoreRunner: false)] public void RunsToCompletionWhenJapaneseResourcesAreLookedUpForMSCorLib(RunnerInfo runnerInfo) diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ResultsDirectoryTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ResultsDirectoryTests.cs index c59053faef07..76e6937772ad 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ResultsDirectoryTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ResultsDirectoryTests.cs @@ -13,7 +13,6 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class ResultsDirectoryTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TrxFileShouldBeCreatedInResultsDirectory(RunnerInfo runnerInfo) { @@ -34,7 +33,6 @@ public void TrxFileShouldBeCreatedInResultsDirectory(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void ResultsDirectoryRelativePathShouldWork(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RunsettingsTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RunsettingsTests.cs index 58ac39da92e2..2816b7e9b401 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RunsettingsTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/RunsettingsTests.cs @@ -313,8 +313,6 @@ public void EnvironmentVariablesSettingsShouldSetEnvironmentVariables(RunnerInfo /// /// [TestMethod] - // patched dotnet is not published on non-windows systems - [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSourceAttribute(useDesktopRunner: false)] [NetCoreTargetFrameworkDataSourceAttribute(useDesktopRunner: false)] public void RunSettingsAreLoadedFromProject(RunnerInfo runnerInfo) diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializationCompatibilityTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializationCompatibilityTests.cs index 79b808c01464..9cb64cea20f4 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializationCompatibilityTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializationCompatibilityTests.cs @@ -38,6 +38,7 @@ public class SerializationCompatibilityTests : AcceptanceTestBase /// Verifies that discovery request/response messages serialize correctly across the version boundary. /// [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [RunnerCompatibilityDataSource()] public void DiscoverTests_LatestRunner_WithOlderTesthosts(RunnerInfo runnerInfo) @@ -73,6 +74,7 @@ public void DiscoverTests_LatestRunner_WithOlderTesthosts(RunnerInfo runnerInfo) /// Verifies that older runners can understand discovery responses from the new STJ-based testhost. /// [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [TestHostCompatibilityDataSource] public void DiscoverTests_OlderRunners_WithLatestTesthost(RunnerInfo runnerInfo) @@ -109,6 +111,7 @@ public void DiscoverTests_OlderRunners_WithLatestTesthost(RunnerInfo runnerInfo) /// Verifies that test run messages (start, result, complete) serialize correctly across versions. /// [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [RunnerCompatibilityDataSource] public void RunTests_LatestRunner_WithOlderTesthosts(RunnerInfo runnerInfo) @@ -148,6 +151,7 @@ public void RunTests_LatestRunner_WithOlderTesthosts(RunnerInfo runnerInfo) /// Verifies that older runners can process execution results from the new STJ-based testhost. /// [TestMethod] + // Compatibility matrix includes the .NET Framework runner/testhost, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [TestHostCompatibilityDataSource] public void RunTests_OlderRunners_WithLatestTesthost(RunnerInfo runnerInfo) diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializerSelectionTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializerSelectionTests.cs index 9558c0f16222..b21d517bd2e8 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializerSelectionTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/SerializerSelectionTests.cs @@ -25,6 +25,9 @@ public void OnNetCoreRunner_ShouldUseSystemTextJson(RunnerInfo runnerInfo) } [TestMethod] + // The .NET Framework runner (and its Jsonite serializer) only runs on Windows; the core counterpart + // is covered by OnNetCoreRunner_ShouldUseSystemTextJson. + [TestCategory("Windows-Review")] [NetFrameworkRunner(Net481TargetFramework)] public void OnNetFrameworkRunner_ShouldUseJsonite(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TelemetryTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TelemetryTests.cs index ec7f1ad8c3a8..a972b9a62c59 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TelemetryTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TelemetryTests.cs @@ -20,7 +20,6 @@ public class TelemetryTests : AcceptanceTestBase private const string LOG_TELEMETRY_PATH = "VSTEST_LOGTELEMETRY_PATH"; [TestMethod] - [NetFullTargetFrameworkDataSourceAttribute(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunTestsShouldPublishMetrics(RunnerInfo runnerInfo) { @@ -30,7 +29,6 @@ public void RunTestsShouldPublishMetrics(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSourceAttribute(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void DiscoverTestsShouldPublishMetrics(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TestCaseFilterTests.cs b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TestCaseFilterTests.cs index 0afd627f4680..32323d9a54e5 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TestCaseFilterTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/TestCaseFilterTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.TestPlatform.AcceptanceTests; public class TestCaseFilterTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSourceAttribute(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithAndOperatorTrait(RunnerInfo runnerInfo) { @@ -27,7 +26,6 @@ public void RunSelectedTestsWithAndOperatorTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithCategoryTraitInMixCase(RunnerInfo runnerInfo) { @@ -44,7 +42,6 @@ public void RunSelectedTestsWithCategoryTraitInMixCase(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithClassNameTrait(RunnerInfo runnerInfo) { @@ -61,7 +58,6 @@ public void RunSelectedTestsWithClassNameTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithFullyQualifiedNameTrait(RunnerInfo runnerInfo) { @@ -80,7 +76,6 @@ public void RunSelectedTestsWithFullyQualifiedNameTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithNameTrait(RunnerInfo runnerInfo) { @@ -97,7 +92,6 @@ public void RunSelectedTestsWithNameTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithOrOperatorTrait(RunnerInfo runnerInfo) { @@ -114,7 +108,6 @@ public void RunSelectedTestsWithOrOperatorTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithPriorityTrait(RunnerInfo runnerInfo) { @@ -135,7 +128,6 @@ public void RunSelectedTestsWithPriorityTrait(RunnerInfo runnerInfo) /// this command should provide same results as /TestCaseFilter:"FullyQualifiedName~UnitTest1". /// [TestMethod] - [NetFullTargetFrameworkDataSource] [NetCoreTargetFrameworkDataSource] public void TestCaseFilterShouldWorkIfOnlyPropertyValueGivenInExpression(RunnerInfo runnerInfo) { @@ -179,7 +171,6 @@ public void DiscoverMstestV1TestsWithAndOperatorTrait(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSourceAttribute(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithNoneTestCategoryFilterMatchesUncategorizedTests(RunnerInfo runnerInfo) { @@ -199,7 +190,6 @@ public void RunSelectedTestsWithNoneTestCategoryFilterMatchesUncategorizedTests( } [TestMethod] - [NetFullTargetFrameworkDataSourceAttribute(inIsolation: true, inProcess: true)] [NetCoreTargetFrameworkDataSource] public void RunSelectedTestsWithNoneTestCategoryNotEqualFilterMatchesCategorizedTests(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/.runsettings b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/.runsettings index 823b5bb2d550..cd8b6eb4daa3 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/.runsettings +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/.runsettings @@ -1,5 +1,2 @@ - - true - \ No newline at end of file diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/FilterSourceIntegrationTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/FilterSourceIntegrationTests.cs index a4d78efa44d9..f7a9c725ac37 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/FilterSourceIntegrationTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/FilterSourceIntegrationTests.cs @@ -16,7 +16,6 @@ namespace Microsoft.TestPlatform.Library.IntegrationTests; public class FilterSourceIntegrationTests : AcceptanceTestBase { [TestMethod] - [NetFullTargetFrameworkDataSource(useDesktopRunner: false)] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void FilterSourcePackage_AllTestsPass(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/CustomTestHostLauncherTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/CustomTestHostLauncherTests.cs index 55d68513a849..9a3f86259bc3 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/CustomTestHostLauncherTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/CustomTestHostLauncherTests.cs @@ -35,6 +35,7 @@ public void Cleanup() } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource()] public void RunTestsWithCustomTestHostLauncherAttachesToDebuggerUsingTheProvidedLauncher(RunnerInfo runnerInfo) @@ -57,6 +58,7 @@ public void RunTestsWithCustomTestHostLauncherAttachesToDebuggerUsingTheProvided } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [TestCategory("Feature")] [WrapperCompatibilityDataSource] diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DataCollectorAttachmentProcessor.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DataCollectorAttachmentProcessor.cs index 32fa1eb8018e..d85cb809771a 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DataCollectorAttachmentProcessor.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DataCollectorAttachmentProcessor.cs @@ -22,6 +22,7 @@ namespace Microsoft.TestPlatform.Library.IntegrationTests.TranslationLayerTests; [TestClass] +// This test runs the packaged .NET Framework vstest.console.exe, which cannot start on Linux/macOS. [TestCategory("Windows-Review")] public class DataCollectorAttachmentProcessor : AcceptanceTestBase { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DifferentTestFrameworkSimpleTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DifferentTestFrameworkSimpleTests.cs index 23ebdf9ca3d8..cd1c7ad13ab6 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DifferentTestFrameworkSimpleTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DifferentTestFrameworkSimpleTests.cs @@ -68,7 +68,8 @@ public void RunTestsWithNunitAdapter(RunnerInfo runnerInfo) } [TestMethod] - // there are logs in the diagnostic log, it is failing with NullReferenceException because path is null + // The xUnit adapter produces no results on Linux/macOS (diagnostic log shows a NullReferenceException because path is null), + // so the run returns an empty sequence and .First() throws. Keep this Windows-only. [TestCategory("Windows-Review")] [NetCoreTargetFrameworkDataSource] public void RunTestsWithXunitAdapter(RunnerInfo runnerInfo) @@ -104,8 +105,8 @@ public void RunTestsWithXunitAdapter(RunnerInfo runnerInfo) } [TestMethod] - [TestCategory("Windows-Review")] // TODO: this does not work with netcore testhost, why? + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] public void RunTestsWithNonDllAdapter(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DiscoverTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DiscoverTests.cs index 5a96e743cd9e..190079f3a324 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DiscoverTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/DiscoverTests.cs @@ -44,6 +44,7 @@ public void Cleanup() } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource] public void DiscoverTestsUsingDiscoveryEventHandler1(RunnerInfo runnerInfo) @@ -62,6 +63,7 @@ public void DiscoverTestsUsingDiscoveryEventHandler1(RunnerInfo runnerInfo) } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource] public void DiscoverTestsUsingDiscoveryEventHandler2AndTelemetryOptedOut(RunnerInfo runnerInfo) @@ -87,7 +89,6 @@ public void DiscoverTestsUsingDiscoveryEventHandler2AndTelemetryOptedOut(RunnerI [TestMethod] [TestCategory("Smoke")] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource(useVsixRunner: true)] public void DiscoverTestsUsingDiscoveryEventHandler2AndTelemetryOptedIn(RunnerInfo runnerInfo) { SetTestEnvironment(_testEnvironment, runnerInfo); @@ -184,6 +185,8 @@ public void DiscoverTestUsingEventHandler2ShouldContainAllSourcesAsFullyDiscover // Normally we test on two runner, against single .NET Testhost, but because source navigation happens in testhost // it is better to test against both desktop and core runners to make sure source navigation discovery works in both scenarios. // We run .NET Runner -> .NET Testhost and .NET Framework Runner -> .NET Frameworks Testhost. + // The .NET Framework runner/testhost is not available on Linux/macOS. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource(useCoreRunner: false)] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void DiscoverTestsUsingSourceNavigation(RunnerInfo runnerInfo) diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/LiveUnitTestingTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/LiveUnitTestingTests.cs index 21afa15e532a..38e5f2a3477d 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/LiveUnitTestingTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/LiveUnitTestingTests.cs @@ -37,6 +37,7 @@ public void Cleanup() [TestMethod] // Touches appdomain settings, preferring .NET Framework testhost here. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] public void DiscoverTestsUsingLiveUnitTesting(RunnerInfo runnerInfo) { @@ -62,6 +63,7 @@ public void DiscoverTestsUsingLiveUnitTesting(RunnerInfo runnerInfo) [TestMethod] // Touches appdomain settings, preferring .NET Framework testhost here. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource] public void RunTestsWithLiveUnitTesting(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs index 5e394623b2a9..7975ecd58e93 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs @@ -46,6 +46,7 @@ public void Cleanup() } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource] public void RunAllTests(RunnerInfo runnerInfo) @@ -65,7 +66,6 @@ public void RunAllTests(RunnerInfo runnerInfo) [TestMethod] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource(useVsixRunner: true)] [TestCategory("Smoke")] public void RunAllTestsFromDlls(RunnerInfo runnerInfo) { @@ -83,6 +83,7 @@ public void RunAllTestsFromDlls(RunnerInfo runnerInfo) } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource()] public void RunAllTestsWithMixedTFMsWillRunTestsFromAllProvidedDllEvenWhenTheyMixTFMs(RunnerInfo runnerInfo) @@ -171,6 +172,9 @@ public void RunTestsWithTelemetryOptedOut(RunnerInfo runnerInfo) [TestMethod] // This is testing the behavior of crash in testhost, run on different testhost, and just .NET runner. + // The assertion below branches on the .NET Framework-specific stack overflow message, and the + // .NET Framework testhost is only available on Windows, so this runs as Windows-Review. + [TestCategory("Windows-Review")] [NetFullTargetFrameworkDataSource(useDesktopRunner: false)] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void RunTestsShouldThrowOnStackOverflowException(RunnerInfo runnerInfo) @@ -195,8 +199,6 @@ public void RunTestsShouldThrowOnStackOverflowException(RunnerInfo runnerInfo) } [TestMethod] - [TestCategory("Windows-Review")] - [NetFullTargetFrameworkDataSource(useDesktopRunner: false)] [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void RunTestsShouldShowProperWarningOnNoTestsForTestCaseFilter(RunnerInfo runnerInfo) { diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTestsWithFilterTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTestsWithFilterTests.cs index decb30085331..3dc564da179b 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTestsWithFilterTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTestsWithFilterTests.cs @@ -37,6 +37,7 @@ public void Cleanup() } [TestMethod] + // WrapperCompatibilityDataSource includes the .NET Framework runner, which is not available on Linux/macOS. [TestCategory("Windows-Review")] [WrapperCompatibilityDataSource] public void RunTestsWithTestCaseFilter(RunnerInfo runnerInfo) diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/SerializeTestRunTests.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/SerializeTestRunTests.cs index 1c470a41b67e..87f27d67874b 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/SerializeTestRunTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/SerializeTestRunTests.cs @@ -17,8 +17,6 @@ namespace Microsoft.TestPlatform.Library.IntegrationTests.TranslationLayerTests; [TestClass] // TODO: this comment seems inaccurate and would mean all our linux and macos tests are broken? -// We need to dogfood the package built in this repo *-dev and we pack tha tp only on windows -[TestCategory("Windows-Review")] public class SerialTestRunDecoratorTests : AcceptanceTestBase { private IVsTestConsoleWrapper? _vstestConsoleWrapper; @@ -51,7 +49,6 @@ public void Cleanup() [TestMethod] // This is testhost concept, try it on combination of testhosts, and .NET Runner. [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] - [NetFullTargetFrameworkDataSource(useDesktopRunner: false)] public void DiscoverTestsAndRunTestsSequentially(RunnerInfo runnerInfo) { // Arrange @@ -73,7 +70,6 @@ public void DiscoverTestsAndRunTestsSequentially(RunnerInfo runnerInfo) [TestMethod] // This is testhost concept, try it on combination of testhosts, and .NET Runner. [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] - [NetFullTargetFrameworkDataSource(useDesktopRunner: false)] public void DiscoverTestsAndRunTestsSequentially_DisabledByFeatureFlag(RunnerInfo runnerInfo) { // Arrange @@ -95,7 +91,6 @@ public void DiscoverTestsAndRunTestsSequentially_DisabledByFeatureFlag(RunnerInf [TestMethod] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource] public void DiscoverTestsAndRunTestsSequentially_IsNotSupportedForSources(RunnerInfo runnerInfo) { // Arrange diff --git a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/TargetFrameworkTestHostDemultiplexer.cs b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/TargetFrameworkTestHostDemultiplexer.cs index bb553f04ca20..c3b2d7d1b9b7 100644 --- a/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/TargetFrameworkTestHostDemultiplexer.cs +++ b/src/vstest/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/TargetFrameworkTestHostDemultiplexer.cs @@ -16,8 +16,6 @@ namespace Microsoft.TestPlatform.Library.IntegrationTests.TranslationLayerTests; [TestClass] -// We need to dogfood the package built in this repo *-dev and we pack tha tp only on windows -[TestCategory("Windows-Review")] public class TargetFrameworkTestHostDemultiplexer : AcceptanceTestBase { private IVsTestConsoleWrapper? _vstestConsoleWrapper; @@ -40,19 +38,16 @@ public void Cleanup() [TestMethod] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource] public void ExecuteContainerInMultiHost(RunnerInfo runnerInfo) => ExecuteContainerInMultiHost(runnerInfo, 3); [TestMethod] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource] public void ExecuteContainerInMultiHost_MoreHostsThanTests(RunnerInfo runnerInfo) => ExecuteContainerInMultiHost(runnerInfo, 20); [TestMethod] [NetCoreTargetFrameworkDataSource] - [NetFullTargetFrameworkDataSource] public void ExecuteSingleContainerInDefaultSingleHost(RunnerInfo runnerInfo) => ExecuteContainerInMultiHost(runnerInfo, -1); diff --git a/src/vstest/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs b/src/vstest/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs index 68bf9ab331cc..b8d8102b9a12 100644 --- a/src/vstest/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs +++ b/src/vstest/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs @@ -37,7 +37,6 @@ public class DefaultTestHostManagerTests private readonly Mock _mockMessageLogger; private readonly Mock _mockProcessHelper; private readonly Mock _mockFileHelper; - private readonly Mock _mockDotnetHostHelper; private readonly Mock _mockEnvironment; private readonly Mock _mockEnvironmentVariable; private readonly DefaultTestHostManager _testHostManager; @@ -54,13 +53,12 @@ public DefaultTestHostManagerTests() _mockProcessHelper = new Mock(); _mockFileHelper = new Mock(); _mockProcessHelper.Setup(ph => ph.GetCurrentProcessFileName()).Returns("vstest.console.exe"); - _mockDotnetHostHelper = new Mock(); _mockEnvironment = new Mock(); _mockEnvironmentVariable = new Mock(); _mockMessageLogger = new Mock(); - _testHostManager = new DefaultTestHostManager(_mockProcessHelper.Object, _mockFileHelper.Object, _mockDotnetHostHelper.Object, _mockEnvironment.Object, _mockEnvironmentVariable.Object); + _testHostManager = new DefaultTestHostManager(_mockProcessHelper.Object, _mockFileHelper.Object, _mockEnvironment.Object, _mockEnvironmentVariable.Object); _testHostManager.Initialize(_mockMessageLogger.Object, $" {Architecture.X64} {Framework.DefaultFramework} {false} "); _startInfo = _testHostManager.GetTestHostProcessStartInfo([], null, default); } @@ -177,38 +175,22 @@ public void GetTestHostProcessStartInfoShouldIncludeTestSourcePathInArgumentsIfN } [TestMethod] - public void GetTestHostProcessStartInfoShouldUseMonoAsHostOnNonWindowsIfNotStartedWithMono() + [DataRow(PlatformOperatingSystem.Unix, "/usr/bin/dotnet")] + [DataRow(PlatformOperatingSystem.Unix, "/usr/bin/mono")] + [DataRow(PlatformOperatingSystem.OSX, "/usr/local/share/dotnet/dotnet")] + [DataRow(PlatformOperatingSystem.OSX, "/usr/local/bin/mono")] + public void GetTestHostProcessStartInfoShouldThrowWhenRunningNetFrameworkTestsOnNonWindows(PlatformOperatingSystem operatingSystem, string currentProcessFileName) { - _mockProcessHelper.Setup(p => p.GetCurrentProcessFileName()).Returns("/usr/bin/dotnet"); - _mockEnvironment.Setup(e => e.OperatingSystem).Returns(PlatformOperatingSystem.Unix); - _mockDotnetHostHelper.Setup(d => d.GetMonoPath()).Returns("/usr/bin/mono"); - var source = @"C:\temp\a.dll"; - - var info = _testHostManager.GetTestHostProcessStartInfo( - new List() { source }, - null, - default); - - Assert.AreEqual("/usr/bin/mono", info.FileName); - Assert.Contains(Path.Combine("TestHostNetFramework", "testhost.exe"), info.Arguments!); - } + // .NET Framework tests can only run on Windows. On other operating systems we no longer + // fall back to Mono and instead fail with a clear, actionable message. + _mockProcessHelper.Setup(p => p.GetCurrentProcessFileName()).Returns(currentProcessFileName); + _mockEnvironment.Setup(e => e.OperatingSystem).Returns(operatingSystem); + var source = "/tmp/a.dll"; - [TestMethod] - public void GetTestHostProcessStartInfoShouldNotUseMonoAsHostOnNonWindowsIfStartedWithMono() - { - _mockProcessHelper.Setup(p => p.GetCurrentProcessFileName()).Returns("/usr/bin/mono"); - _mockEnvironment.Setup(e => e.OperatingSystem).Returns(PlatformOperatingSystem.Unix); - _mockDotnetHostHelper.Setup(d => d.GetMonoPath()).Returns("/usr/bin/mono"); - var source = @"C:\temp\a.dll"; - - var info = _testHostManager.GetTestHostProcessStartInfo( - new List() { source }, - null, - default); + var exception = Assert.ThrowsExactly( + () => _testHostManager.GetTestHostProcessStartInfo(new List() { source }, null, default)); - var testHostPath = Path.Combine("TestHostNetFramework", "testhost.exe"); - Assert.EndsWith(testHostPath, info.FileName); - Assert.DoesNotContain(testHostPath, info.Arguments!); + Assert.Contains("Running .NET Framework tests is supported on Windows only", exception.Message); } [TestMethod] @@ -656,7 +638,7 @@ public TestableTestHostManager( IProcessHelper processHelper, bool shared, IMessageLogger logger) - : base(processHelper, new FileHelper(), new DotnetHostHelper(), new PlatformEnvironment(), new EnvironmentVariableHelper()) + : base(processHelper, new FileHelper(), new PlatformEnvironment(), new EnvironmentVariableHelper()) { Initialize(logger, $" {architecture} {framework} {!shared} "); } diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/AeDebuggerArgumentProcessorTest.cs b/src/vstest/test/vstest.console.UnitTests/Processors/AeDebuggerArgumentProcessorTest.cs index c8b1645c71ff..bac053c84a67 100644 --- a/src/vstest/test/vstest.console.UnitTests/Processors/AeDebuggerArgumentProcessorTest.cs +++ b/src/vstest/test/vstest.console.UnitTests/Processors/AeDebuggerArgumentProcessorTest.cs @@ -18,6 +18,7 @@ namespace vstest.console.UnitTests.Processors; [TestClass] +// AeDebug (post-mortem debugger) is a Windows-only feature and these tests rely on Windows path semantics. [TestCategory("Windows-Review")] public class AeDebuggerArgumentProcessorTest { diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/EnableBlameArgumentProcessorTests.cs b/src/vstest/test/vstest.console.UnitTests/Processors/EnableBlameArgumentProcessorTests.cs index bed998f47f96..4e9ebdb118e0 100644 --- a/src/vstest/test/vstest.console.UnitTests/Processors/EnableBlameArgumentProcessorTests.cs +++ b/src/vstest/test/vstest.console.UnitTests/Processors/EnableBlameArgumentProcessorTests.cs @@ -393,7 +393,6 @@ public void InitializeShouldCreateEntryForBlameAlongWithCollectHangDumpParameter } [TestMethod] - [TestCategory("Windows-Review")] public void InitializeMonitorPostmortemDebuggerShouldGenerateCorrectConfiguration() { var runsettingsString = string.Format(CultureInfo.CurrentCulture, _defaultRunSettings, ""); @@ -434,7 +433,6 @@ public void InitializeMonitorPostmortemDebuggerShouldGenerateCorrectConfiguratio } [TestMethod] - [TestCategory("Windows-Review")] public void InitializeMonitorPostmortemDebuggerShouldGenerateCorrectConfigurationAlsoIfIncomplete() { var runsettingsString = string.Format(CultureInfo.CurrentCulture, _defaultRunSettings, ""); diff --git a/src/vstest/test/vstest.console.UnitTests/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessorTests.cs b/src/vstest/test/vstest.console.UnitTests/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessorTests.cs index 59537431abfc..ee748fa37c30 100644 --- a/src/vstest/test/vstest.console.UnitTests/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessorTests.cs +++ b/src/vstest/test/vstest.console.UnitTests/Processors/ShowDeprecateDotnetVStestMessageArgumentProcessorTests.cs @@ -7,7 +7,6 @@ namespace vstest.console.UnitTests.Processors; [TestClass] -[TestCategory("Windows-Review")] public class ShowDeprecateDotnetVStestMessageArgumentProcessorTests { [TestMethod] From f30569ce51d42bfe072d5ef9664cc7bc79a03bac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 30 Jun 2026 02:14:54 +0000 Subject: [PATCH 2/2] Update dependencies from build 320725 [[ commit created by automation ]] --- src/vstest/eng/Version.Details.props | 6 +++--- src/vstest/eng/Version.Details.xml | 16 ++++++++-------- src/vstest/global.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vstest/eng/Version.Details.props b/src/vstest/eng/Version.Details.props index 018a5207d827..48101843ed95 100644 --- a/src/vstest/eng/Version.Details.props +++ b/src/vstest/eng/Version.Details.props @@ -6,11 +6,11 @@ This file should be imported by eng/Versions.props - 11.0.0-beta.26310.1 + 11.0.0-beta.26325.1 2.0.0 - 0.2.0-preview.26281.102 + 0.2.0-preview.26328.102 6.0.2 10.0.0 @@ -18,7 +18,7 @@ This file should be imported by eng/Versions.props 1.1.0-beta2-19575-01 1.1.0-beta2-19575-01 - 18.9.0-preview.26319.2 + 18.9.0-preview.26326.3 diff --git a/src/vstest/eng/Version.Details.xml b/src/vstest/eng/Version.Details.xml index 3089e4649610..7b327a1faf3e 100644 --- a/src/vstest/eng/Version.Details.xml +++ b/src/vstest/eng/Version.Details.xml @@ -1,14 +1,14 @@ - + - + https://dev.azure.com/devdiv/DevDiv/_git/vs-code-coverage - 42b0aaaa4ba69dd89c33eec653184f97a5c52340 + 721d283a3c2f250c9d24decdc733f8dd9a2cfc48 - + https://github.com/dotnet/dotnet - e6542746cf944ff2a1a595edf2af006ef3046784 + 7c528f6e19c5245206de3dc561eb8a110bf9f746 @@ -26,9 +26,9 @@ - + https://github.com/dotnet/arcade - 0a80b038bcc0d76b2f26c7f22062942de75779e6 + b076228a542025c4f879f254d38adb5cf34a2475 https://github.com/dotnet/symreader-converter @@ -39,4 +39,4 @@ c5ba7c88f92e2dde156c324a8c8edc04d9fa4fe0 - + \ No newline at end of file diff --git a/src/vstest/global.json b/src/vstest/global.json index 50dcdab9f4bf..22c52bd3a4ac 100644 --- a/src/vstest/global.json +++ b/src/vstest/global.json @@ -17,7 +17,7 @@ "dotnet": "11.0.100-preview.5.26227.104" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26310.1" + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26325.1" }, "test": { "runner": "Microsoft.Testing.Platform"