Skip to content
Draft
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
7 changes: 7 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -262,6 +263,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build

- task: PublishTestResults@2
Expand Down Expand Up @@ -309,6 +311,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build

- task: PublishTestResults@2
Expand Down Expand Up @@ -354,6 +357,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -390,6 +394,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -457,6 +462,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build and Test $(_testKind) $(transparentCompiler)

- task: PublishTestResults@2
Expand Down Expand Up @@ -530,6 +536,7 @@ stages:
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
NativeToolsOnMachine: true
DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING: 1
displayName: Build / Test

- task: PublishTestResults@2
Expand Down
14 changes: 8 additions & 6 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str

$testResultsDir = "$ArtifactsDir\TestResults\$configuration"
$testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog"


[Console]::InputEncoding | Write-Host

[Console]::InputEncoding

# MTP requires --solution flag for .sln files
$testTarget = if ($testProject.EndsWith('.sln')) { "--solution ""$testProject""" } else { "--project ""$testProject""" }

Expand All @@ -383,9 +387,7 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
$reportArgs = "--report-xunit-trx --report-xunit-trx-filename ""$testLogFileName"""
}

$test_args = "test $testTarget -c $configuration -f $targetFramework $reportArgs --results-directory ""$testResultsDir"" /bl:$testBinLogPath"
# MTP HangDump extension replaces VSTest --blame-hang-timeout
$test_args += " --hangdump --hangdump-timeout 5m --hangdump-type Full"
$test_args = "run $testTarget --filter-method ""*fsiAndModifiers"" --no-progress --output detailed -c $configuration -f $targetFramework $reportArgs --results-directory ""$testResultsDir"" /bl:$testBinLogPath"

if (-not $noVisualStudio -or $norestore) {
$test_args += " --no-restore"
Expand Down Expand Up @@ -601,11 +603,11 @@ try {
$script:BuildMessage = "Failure running tests"

if ($testCoreClr) {
TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework
TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework
}

if ($testDesktop) {
TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework
TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework
}

if ($testFSharpCore) {
Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function Test() {
reportargs="--report-xunit-trx --report-xunit-trx-filename $testlogfilename"
fi

args=(test $testtarget "$testproject" --no-build -c "$configuration" -f "$targetframework" $reportargs --results-directory "$testresultsdir" --hangdump --hangdump-timeout 5m --hangdump-type Full)
args=(test $testtarget "$testproject" --no-build --filter-method "*fsiAndModifiers" -c "$configuration" -f "$targetframework" $reportargs --results-directory "$testresultsdir" --hangdump --hangdump-timeout 5m --hangdump-type Full)

"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" || exit $?
}
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.101",
"version": "11.0.100-preview.1.26104.118",
"allowPrerelease": true,
"paths": [
".dotnet",
Expand All @@ -12,7 +12,7 @@
"runner": "Microsoft.Testing.Platform"
},
"tools": {
"dotnet": "10.0.101",
"dotnet": "11.0.100-preview.1.26104.118",
"vs": {
"version": "18.0",
"components": [
Expand Down
7 changes: 1 addition & 6 deletions tests/FSharp.Test.Utilities/TestFramework.fs
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,7 @@ module Command =
let exec dir envVars (redirect:RedirectInfo) path args =

#if !NETCOREAPP
let ensureConsole () =
// Set UTF-8 encoding for console input/output to ensure FSI receives UTF-8 data.
// This is needed because on net472 ProcessStartInfo.StandardInputEncoding is unavailable,
// so the spawned process inherits the console's encoding settings.
Console.InputEncoding <- Text.UTF8Encoding(false)
Console.OutputEncoding <- Text.UTF8Encoding(false)
let ensureConsole () = ()
#else
let ensureConsole () = ()
#endif
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/scriptlib.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module Scripting =
| 0 ->
Success(string out)
| errCode ->
let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'" exePath arguments workDir
let msg = $"Console input encoding is '{System.Console.InputEncoding}', console is {System.Console.In}. Child process redirects input? '{p.StartInfo.RedirectStandardInput}'. \r\nStdOut:\r\n{out}\r\n\r\nStdErr:\r\n{err}"
ErrorLevel (msg, errCode)

type OutPipe (writer: TextWriter) =
Expand Down
Loading