Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Microsoft.Diagnostics.NETCore.Client.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions azure-pipelines-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
-configuration $(_BuildConfig)
-prepareMachine
/p:Test=false
env:
# https://github.com/microsoft/testfx/issues/6767
DOTNET_HOST_PATH: '$(Build.SourcesDirectory)/.dotnet/dotnet.exe'
displayName: Windows Build

- task: CodeQL3000Finalize@0
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ extends:
/p:ProductsToBuild=$(_Products)
/p:Test=false
name: Build
env:
# https://github.com/microsoft/testfx/issues/6767
DOTNET_HOST_PATH: '$(Build.SourcesDirectory)/.dotnet/dotnet.exe'
displayName: Build

- ${{ if eq(parameters.SkipTests, False) }}:
Expand Down
18 changes: 17 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ stages:
/p:Test=false
/p:FastAcceptanceTest=true
name: Build
env:
# https://github.com/microsoft/testfx/issues/6767
DOTNET_HOST_PATH: '$(Build.SourcesDirectory)/.dotnet/dotnet.exe'
displayName: Build

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -263,12 +266,18 @@ stages:
# Because the build step is using -ci flag, restore is done in a local .packages directory.
# We need to pass NUGET_PACKAGES so that when dotnet test is doing evaluation phase on the projects, it can resolve .props/.targets from packages and import them.
# Otherwise, props/targets are not imported. It's important that they are imported so that IsTestingPlatformApplication ends up being set.
- script: dotnet test --solution NonWindowsTests.slnf -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)/artifacts/TestResults/$(_BuildConfig)/TestStep.binlog --no-progress -p:UsingDotNetTest=true
- task: PowerShell@2
name: Test
displayName: Test
inputs:
targetType: filePath
filePath: './run.ps1'
failOnStderr: true
showWarnings: true
env:
DOTNET_ROOT: $(Build.SourcesDirectory)/.dotnet
NUGET_PACKAGES: $(Build.SourcesDirectory)/.packages
DOTNET_CLI_TEST_TRACEFILE: $(Build.SourcesDirectory)/dumps/tracelog.txt
DOTNET_CLI_CONTEXT_VERBOSE: 1

- task: PublishBuildArtifacts@1
Expand All @@ -278,6 +287,13 @@ stages:
ArtifactName: TestResults_MacOs_$(_BuildConfig)_Attempt$(System.JobAttempt)
condition: always()

- task: PublishBuildArtifacts@1
displayName: 'Publish Dumps'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/dumps'
ArtifactName: TestResults_MacOs_$(_BuildConfig)_Attempt$(System.JobAttempt)_Dumps
condition: always()

- task: CopyFiles@2
displayName: 'Copy binlogs'
inputs:
Expand Down
11 changes: 10 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ Param(
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

# Workaround for DOTNET_HOST_PATH not being set by older MSBuild
# Removal is tracked by https://github.com/microsoft/testfx/issues/6767
if (-not $env:DOTNET_HOST_PATH) {
Copy link
Member

Choose a reason for hiding this comment

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

Note that our CI sometimes uses globally installed SDK so we needed to tweak the logic a bit: dotnet/roslyn#80842, I'm not sure if that's something you need to do as well

Copy link
Member

@Youssef1313 Youssef1313 Oct 22, 2025

Choose a reason for hiding this comment

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

I think we never use globally installed SDK. I'll keep an eye to official builds after merging this to ensure they are still not broken. Thanks for the note!

$env:DOTNET_HOST_PATH = [System.IO.Path]::GetFullPath((Join-Path (Join-Path (Join-Path $PSScriptRoot '..') '.dotnet') 'dotnet'))
if (-not (Test-Path $env:DOTNET_HOST_PATH)) {
$env:DOTNET_HOST_PATH = "$($env:DOTNET_HOST_PATH).exe"
}
}

if ($vs -or $vscode) {
. $PSScriptRoot\common\tools.ps1

Expand All @@ -52,7 +61,7 @@ if ($vs -or $vscode) {
# Disable .NET runtime signature validation errors which errors for local builds
$env:VSDebugger_ValidateDotnetDebugLibSignatures=0;

# Enables the logginc of Json RPC messages if diagnostic logging for Test Explorer is enabled in Visual Studio.
# Enables the logging of Json RPC messages if diagnostic logging for Test Explorer is enabled in Visual Studio.
$env:_TestingPlatformDiagnostics_=1;

if ($vs) {
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "10.0.100-rc.2.25464.104",
"dotnet": "10.0.100-rtm.25512.102",
"runtimes": {
"dotnet": [
"3.1.32",
Expand All @@ -23,7 +23,7 @@
}
},
"sdk": {
"version": "10.0.100-rc.2.25464.104",
"version": "10.0.100-rtm.25512.102",
"paths": [
".dotnet",
"$host$"
Expand Down
58 changes: 58 additions & 0 deletions run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Write-Host "Starting dotnet test"


Start-Job { $global:PSScriptRoot = $using:PSScriptRoot; dotnet test --solution NonWindowsTests.slnf --no-build -bl:$PSScriptRoot/artifacts/TestResults/Debug/TestStep.binlog --no-progress -p:UsingDotNetTest=true }

Write-Host "Started dotnet test"

# Import-Module "$PSScriptRoot/Microsoft.Diagnostics.NETCore.Client.dll"

# $dir = "$PSScriptRoot/dumps"

dotnet tool install --global dotnet-stack

Start-Sleep -Duration ([TimeSpan]::FromMinutes(20))

Write-Host "Timedout!! Dumping now..."

# New-Item -ItemType Directory -Path $dir -Force -ErrorAction Ignore

Write-Host "Getting processes..."

$processes = Get-Process -Name "Microsoft.Testing*","MSTest*","dotnet" -ErrorAction Ignore

Write-Host "Got processes..."
Write-Host $processes

ps -eo pid,command

# dotnet stack ps

if (-not $processes) {
Write-Host "No processes found."
}

Write-Host "Iterating."

foreach ($process in $processes) {
$name = "$($process.Id)_$($process.Name)"

Write-Host "Dumping $name"

# dotnet stack report --process-id $process.Id
try {
# $client = [Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient]::new($process.Id);
# $fullPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$dir/$name.dmp")
# $client.WriteDump("Triage", $fullPath, $true);
# Write-Host "Dump written"
try {
$process.Kill()
}
catch {
Write-Host "$_"
}
}
catch {
Write-Host "$_"
}
}
Loading