diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml
index 326cc76470341c..7b404e2c37b745 100644
--- a/eng/pipelines/common/evaluate-default-paths.yml
+++ b/eng/pipelines/common/evaluate-default-paths.yml
@@ -116,6 +116,11 @@ jobs:
- src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/*
- src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/*
- src/mono/mono/*
+ - subset: wasmdebuggertests
+ include:
+ - src/mono/wasm/debugger/*
+ - src/mono/wasm/runtime/*
+ - src/mono/mono/*
- ${{ if ne(parameters.extraSubsets, '') }}:
- ${{ parameters.extraSubsets }}
diff --git a/eng/pipelines/runtime-manual.yml b/eng/pipelines/runtime-manual.yml
index 3be3efb85c9e2c..77f7b29cad8ac4 100644
--- a/eng/pipelines/runtime-manual.yml
+++ b/eng/pipelines/runtime-manual.yml
@@ -497,6 +497,69 @@ jobs:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+# Wasm debugger tests
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ variables:
+ # map dependencies variables to local variables
+ - name: wasmdebuggertestsContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: Mono_DebuggerTests
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true),
+ eq(variables['isManualOrIsNotPR'], true),
+ eq(variables['isFullMatrix'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ scenarios:
+ - wasmdebuggertests
+
+# Wasm debugger tests - windows
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm_win
+ variables:
+ # map dependencies variables to local variables
+ - name: wasmdebuggertestsContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: Windows_wasm_DebuggerTests
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=windows
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true),
+ eq(variables['isManualOrIsNotPR'], true),
+ eq(variables['isFullMatrix'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ extraHelixArguments: /p:BrowserHost=windows
+ scenarios:
+ - wasmdebuggertests
+
#
# Build the whole product using Mono for Android and run runtime tests with Android emulator
#
diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml
index 7a76fbcd117a78..79ed215e3a6393 100644
--- a/eng/pipelines/runtime-staging.yml
+++ b/eng/pipelines/runtime-staging.yml
@@ -616,6 +616,67 @@ jobs:
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
+# Wasm debugger tests
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ variables:
+ # map dependencies variables to local variables
+ - name: wasmdebuggertestsContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: Mono_DebuggerTests
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true),
+ eq(variables['isFullMatrix'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ scenarios:
+ - wasmdebuggertests
+
+# Wasm debugger tests - windows
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm_win
+ variables:
+ # map dependencies variables to local variables
+ - name: wasmdebuggertestsContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: Windows_wasm_DebuggerTests
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=windows
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true),
+ eq(variables['isFullMatrix'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ extraHelixArguments: /p:BrowserHost=windows
+ scenarios:
+ - wasmdebuggertests
+
#
# CoreCLR Build for running Apple Silicon libraries-innerloop
#
diff --git a/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt b/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
new file mode 100644
index 00000000000000..d4ef9dcbfc399b
--- /dev/null
+++ b/eng/testing/scenarios/WasmDebuggerTestsJobsList.txt
@@ -0,0 +1,18 @@
+DebuggerTests.ArrayTests
+DebuggerTests.AssignmentTests
+DebuggerTests.AsyncTests
+DebuggerTests.BadHarnessInitTests
+DebuggerTests.BreakpointTests
+DebuggerTests.CallFunctionOnTests
+DebuggerTests.CustomViewTests
+DebuggerTests.DateTimeTests
+DebuggerTests.DelegateTests
+DebuggerTests.EvaluateOnCallFrameTests
+DebuggerTests.ExceptionTests
+DebuggerTests.GetPropertiesTests
+DebuggerTests.HarnessTests
+DebuggerTests.MonoJsTests
+DebuggerTests.PointerTests
+DebuggerTests.SetVariableValueTests
+DebuggerTests.MiscTests
+DebuggerTests.SteppingTests
diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets
index 67a781d1058b67..866e80d596f3da 100644
--- a/eng/testing/workloads-testing.targets
+++ b/eng/testing/workloads-testing.targets
@@ -36,10 +36,17 @@
- <_DotNetInstallScriptPath Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(DOTNET_INSTALL_DIR)/dotnet-install.sh
- <_DotNetInstallScriptPath Condition=" $([MSBuild]::IsOSPlatform('windows'))">$(RepoRoot).dotnet\dotnet-install.ps1
+ <_DotNetInstallScriptName Condition="!$([MSBuild]::IsOSPlatform('windows'))">dotnet-install.sh
+ <_DotNetInstallScriptName Condition=" $([MSBuild]::IsOSPlatform('windows'))">dotnet-install.ps1
+
+ <_DotNetInstallScriptPath>$(ArtifactsObjDir)$(_DotNetInstallScriptName)
+
+
diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj
index 9051d411c55028..6fcbb9d4e59475 100644
--- a/src/libraries/sendtohelixhelp.proj
+++ b/src/libraries/sendtohelixhelp.proj
@@ -32,6 +32,7 @@
<_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == '' and ('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm')">01:00:00
<_workItemTimeout Condition="'$(Scenario)' == 'BuildWasmApps' and '$(_workItemTimeout)' == ''">01:30:00
<_workItemTimeout Condition="'$(TargetOS)' == 'Browser' and '$(NeedsToBuildWasmAppsOnHelix)' == 'true'">01:00:00
+ <_workItemTimeout Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmDebuggerTests'">00:10:00
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == '' and '$(Outerloop)' == 'true'">00:20:00
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == ''">00:15:00
<_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == ''">00:30:00
@@ -40,6 +41,7 @@
$(TestArchiveRuntimeFile)
+ $(TestArchiveTestsRoot)**/Wasm.Debugger.Tests.zip
$(TestArchiveTestsRoot)**/*.zip
$(Configuration)
@@ -54,11 +56,14 @@
$(TestRunNamePrefix)$(TestRunNamePrefixSuffix)-
$(TestRunNamePrefix)$(Scenario)-
+ true
$(RepositoryEngineeringDir)\testing\scenarios\BuildWasmAppsJobsList.txt
+ $(RepositoryEngineeringDir)\testing\scenarios\WasmDebuggerTestsJobsList.txt
+ true
$(WaitForWorkItemCompletion)
true
-
+
true
$(RepoRoot)src\mono\wasm\emsdk\
@@ -66,6 +71,7 @@
true
true
true
+ true
dotnet-workload
sdk-no-workload
@@ -116,7 +122,7 @@
We also run some network tests to this server and so, we are running it on both HTTP and HTTPS.
For the HTTPS endpoint we need development SSL certificate.
-->
- true
+ true
true
@@ -448,6 +454,10 @@
+
+
+
+
<_WorkItem Include="$(TestArchiveRoot)browseronly/**/*.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" />
-
+
%(Identity)
$(HelixCommand)
$(_workItemTimeout)
+
+
<_BuildWasmAppsPayloadArchive>@(_WorkItem)
+ <_WasmDebuggerTestsPayloadArchive>@(_WorkItem)
@@ -481,6 +495,19 @@
+
+
+ $(_WasmDebuggerTestsPayloadArchive)
+
+
+ set TEST_ARGS=--filter "FullyQualifiedName~%(Identity)^&Category!=windows-failing"
+ export TEST_ARGS="--filter FullyQualifiedName~%(Identity)&Category!=linux-failing"
+
+ $(HelixCommand)
+ $(_workItemTimeout)
+
+
+
dotnet exec $XHARNESS_CLI_PATH
$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output
@@ -493,7 +520,7 @@
--browser-path=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe
-
+
<_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/*.Console.Sample.zip" />
@@ -526,6 +553,10 @@
ContinueOnError="true"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true" />
+
+
+
+
-
+
+
diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile
index 04828bba7240ce..d3f9b3bf08cb2a 100644
--- a/src/mono/wasm/Makefile
+++ b/src/mono/wasm/Makefile
@@ -23,6 +23,7 @@ SYSTEM_NATIVE_LIBDIR?=$(TOP)/src/native/libs/System.Native
_MSBUILD_WASM_BUILD_ARGS=/p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=$(CONFIG)
XHARNESS_BROWSER?=chrome
EMCC_DEFAULT_RSP=$(NATIVE_BIN_DIR)/src/emcc-default.rsp
+HELIX_TARGET_QUEUE?=Ubuntu.1804.Amd64.Open
all: build-native icu-files source-files header-files
@@ -164,6 +165,32 @@ run-build-tests:
run-browser-tests-%:
PATH="$(GECKODRIVER):$(CHROMEDRIVER):$(PATH)" XHARNESS_COMMAND="test-browser --browser=$(XHARNESS_BROWSER)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)
+build-debugger-tests-helix:
+ $(DOTNET) build -restore -bl:$(TOP)/artifacts/log/$(CONFIG)/Wasm.Debugger.Tests.binlog \
+ /p:ContinuousIntegrationBuild=true /p:ArchiveTests=true \
+ $(TOP)/src/tests/BuildWasmApps/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj \
+ $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)
+
+submit-debugger-tests-helix: build-debugger-tests-helix
+ EMSDK_PATH=$(EMSDK_PATH) BUILD_REASON=wasm-test SYSTEM_TEAMPROJECT=public BUILD_REPOSITORY_NAME=dotnet/runtime BUILD_SOURCEBRANCH=main \
+ $(TOP)/eng/common/msbuild.sh --ci -restore $(TOP)/src/libraries/sendtohelix.proj \
+ /p:TestRunNamePrefixSuffix=WasmDebugger /p:HelixBuild=`date "+%Y%m%d.%H%M"` /p:Creator=`whoami` \
+ /bl:$(TOP)/artifacts/log/$(CONFIG)/SendToHelix.binlog -p:HelixTargetQueue=$(HELIX_TARGET_QUEUE) \
+ /p:RuntimeFlavor=mono /p:TargetRuntimeIdentifier= /p:MonoForceInterpreter= /p:TestScope=innerloop \
+ /p:_Scenarios=wasmdebuggertests \
+ $(_MSBUILD_WASM_BUILD_ARGS) \
+ $(MSBUILD_ARGS)
+
+submit-tests-helix:
+ echo "\n** This will submit all the available test zip files to helix **\n"
+ EMSDK_PATH=$(EMSDK_PATH) BUILD_REASON=wasm-test SYSTEM_TEAMPROJECT=public BUILD_REPOSITORY_NAME=dotnet/runtime BUILD_SOURCEBRANCH=main \
+ $(TOP)/eng/common/msbuild.sh --ci -restore $(TOP)/src/libraries/sendtohelix.proj \
+ /p:TestRunNamePrefixSuffix=WasmTests /p:HelixBuild=`date "+%Y%m%d.%H%M"` /p:Creator=`whoami` \
+ /bl:$(TOP)/artifacts/log/$(CONFIG)/SendToHelix.binlog -v:n -p:HelixTargetQueue=$(HELIX_TARGET_QUEUE) \
+ /p:RuntimeFlavor=mono /p:TargetRuntimeIdentifier= /p:MonoForceInterpreter= /p:TestScope=innerloop \
+ $(_MSBUILD_WASM_BUILD_ARGS) \
+ $(MSBUILD_ARGS)
+
run-debugger-tests:
if [ ! -z "$(TEST_FILTER)" ]; then \
$(DOTNET) test $(TOP)/src/mono/wasm/debugger/DebuggerTestSuite $(MSBUILD_ARGS) --filter FullyQualifiedName~$(TEST_FILTER) $(TEST_ARGS); \
diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets
index 1185fc11a562e0..1df620145bea36 100644
--- a/src/mono/wasm/build/WasmApp.targets
+++ b/src/mono/wasm/build/WasmApp.targets
@@ -207,9 +207,13 @@
<_ParsedRuntimeConfigFilePath Condition="'$(_WasmRuntimeConfigFilePath)' != ''">$([System.IO.Path]::GetDirectoryName($(_WasmRuntimeConfigFilePath)))\runtimeconfig.bin
-
-
+
+
+
<_WasmAssembliesInternal Remove="@(_WasmAssembliesInternal)" />
diff --git a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
index f5dc5ecca471b9..074a953b694ae8 100644
--- a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
+++ b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
@@ -160,7 +160,11 @@ async Task ConnectProxy(HttpContext context)
try
{
using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
- builder.AddSimpleConsole(options => options.SingleLine = true)
+ builder.AddSimpleConsole(options =>
+ {
+ options.SingleLine = true;
+ options.TimestampFormat = "[HH:mm:ss] ";
+ })
.AddFilter(null, LogLevel.Information)
);
diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
index e5579df8f86487..6fb9b309d88e28 100644
--- a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
+++ b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
@@ -824,14 +824,14 @@ internal void AddMethod(MethodInfo mi)
return (start.StartLocation.Line, start.StartLocation.Column, end.EndLocation.Line, end.EndLocation.Column);
}
- private static async Task GetDataAsync(Uri uri, CancellationToken token)
+ private async Task GetDataAsync(Uri uri, CancellationToken token)
{
var mem = new MemoryStream();
try
{
if (uri.IsFile && File.Exists(uri.LocalPath))
{
- using (FileStream file = File.Open(uri.LocalPath, FileMode.Open))
+ using (FileStream file = File.Open(SourceUri.LocalPath, FileMode.Open))
{
await file.CopyToAsync(mem, token).ConfigureAwait(false);
mem.Position = 0;
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs
index 05d3d6cccbf66d..82057f4c75bd39 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs
@@ -4,13 +4,14 @@
using System;
using System.Linq;
using System.Threading.Tasks;
-using Microsoft.WebAssembly.Diagnostics;
using Newtonsoft.Json.Linq;
using Xunit;
namespace DebuggerTests
{
-
+ // https://github.com/dotnet/runtime/issues/62661
+ [Trait("Category", "windows-failing")]
+ [Trait("Category", "linux-failing")]
public class ArrayTests : DebuggerTestBase
{
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs
index 0601552db6b606..7a5111b3647122 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs
@@ -46,19 +46,21 @@ async Task InspectVariableBeforeAndAfterAssignment(string clazz, JObject checkDe
// 1) check un-assigned variables
await StepAndCheck(StepKind.Into, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, "TestedMethod",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
Assert.Equal(2, locals.Count());
Check(locals, "r", checkDefault);
+ await Task.CompletedTask;
}
);
// 2) check assigned variables
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-assignment-test.cs", -1, -1, "TestedMethod", times: 3,
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
Assert.Equal(2, locals.Count());
Check(locals, "r", checkValue);
+ await Task.CompletedTask;
}
);
}
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
index f3bf3c8ecb4a6f..b80a8f429b4827 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
@@ -257,38 +257,45 @@ await EvaluateAndCheck(
"window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);",
"dotnet://debugger-test.dll/debugger-test2.cs", 58, 8,
"BreakOnDebuggerBreakCommand",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 59, 8, "BreakOnDebuggerBreakCommand",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 60, 8, "BreakOnDebuggerBreakCommand",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 20);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 61, 8, "BreakOnDebuggerBreakCommand",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 50);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 62, 4, "BreakOnDebuggerBreakCommand",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 100);
+ await Task.CompletedTask;
}
);
}
[Fact]
+ [Trait("Category", "windows-failing")] // https://github.com/dotnet/runtime/issues/62823
+ [Trait("Category", "linux-failing")] // https://github.com/dotnet/runtime/issues/62823
public async Task BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded()
{
int line = 7;
@@ -370,24 +377,27 @@ public async Task DebugHotReloadMethodAddBreakpoint()
CheckBool(locals, "c", true);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 31, 12, "StaticMethod3",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "d", 10);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 32, 12, "StaticMethod3",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "d", 10);
CheckNumber(locals, "e", 20);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 33, 8, "StaticMethod3",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "d", 10);
CheckNumber(locals, "e", 20);
CheckNumber(locals, "f", 50);
+ await Task.CompletedTask;
}
);
}
@@ -408,37 +418,42 @@ public async Task DebugHotReloadMethodEmpty()
pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 12, "StaticMethod4");
locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value());
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "StaticMethod4",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "StaticMethod4",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
CheckNumber(locals, "b", 20);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "StaticMethod4",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
CheckNumber(locals, "b", 20);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "StaticMethod4",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
CheckNumber(locals, "b", 20);
+ await Task.CompletedTask;
}
);
await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "StaticMethod4",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
CheckNumber(locals, "b", 20);
+ await Task.CompletedTask;
}
);
pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 8, "StaticMethod4");
@@ -456,9 +471,10 @@ await EvaluateAndCheck(
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 3);
+ await Task.CompletedTask;
}
);
@@ -480,9 +496,10 @@ await EvaluateAndCheck(
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 0);
+ await Task.CompletedTask;
}
);
@@ -491,9 +508,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 3);
+ await Task.CompletedTask;
});
await SendCommandAndCheck(null, "Debugger.resume",
@@ -501,9 +519,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 6);
+ await Task.CompletedTask;
});
await SendCommandAndCheck(null, "Debugger.resume",
@@ -511,9 +530,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 9);
+ await Task.CompletedTask;
});
await SendCommandAndCheck(null, "Debugger.resume",
@@ -547,9 +567,10 @@ await EvaluateAndCheck(
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 0);
+ await Task.CompletedTask;
}
);
@@ -558,9 +579,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 1);
+ await Task.CompletedTask;
});
await SendCommandAndCheck(null, "Debugger.resume",
@@ -568,9 +590,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
bp_conditional.Value["locations"][0]["lineNumber"].Value(),
bp_conditional.Value["locations"][0]["columnNumber"].Value(),
"LoopToBreak",
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
CheckNumber(locals, "i", 2);
+ await Task.CompletedTask;
});
}
@@ -642,7 +665,7 @@ await EvaluateAndCheck(
}
);
}
-
+
[Fact]
public async Task DebuggerAttributeNoStopInDebuggerHidden()
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs
index 2d3707fec1d8d8..8115604204a81d 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/DateTimeTests.cs
@@ -8,7 +8,7 @@
namespace DebuggerTests
{
- public class DateTimeList : DebuggerTestBase
+ public class DateTimeTests : DebuggerTestBase
{
[Theory]
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
index 1329e284eb066a..fbc176dc2ca5e3 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
@@ -40,17 +40,30 @@ protected static string DebuggerTestAppPath
static protected string FindTestPath()
{
- var asm_dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ string test_app_path = Environment.GetEnvironmentVariable("DEBUGGER_TEST_PATH");
+
+ if (string.IsNullOrEmpty(test_app_path))
+ {
+ var asm_dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
#if DEBUG
- var config="Debug";
+ var config="Debug";
#else
- var config="Release";
-#endif
- var test_app_path = Path.Combine(asm_dir, "..", "..", "..", "debugger-test", config, "publish");
+ var config="Release";
+#endif
+ test_app_path = Path.Combine(asm_dir, "..", "..", "..", "debugger-test", config);
+
+ if (string.IsNullOrEmpty(test_app_path))
+ throw new Exception("Could not figure out debugger-test app path from the 'DEBUGGER_TEST_PATH' " +
+ $"environment variable, or based on the test suite location ({asm_dir})");
+ }
+
+ if (!string.IsNullOrEmpty(test_app_path))
+ test_app_path = Path.Combine(test_app_path, "AppBundle");
+
if (File.Exists(Path.Combine(test_app_path, "debugger-driver.html")))
return test_app_path;
- throw new Exception($"Could not figure out debugger-test app path ({test_app_path}) based on the test suite location ({asm_dir})");
+ throw new Exception($"Cannot find 'debugger-driver.html' in {test_app_path}");
}
static string[] PROBE_LIST = {
@@ -63,21 +76,32 @@ static protected string FindTestPath()
};
static string chrome_path;
- static string FindChromePath()
+ static string GetChromePath()
{
- if (chrome_path != null)
- return chrome_path;
+ if (string.IsNullOrEmpty(chrome_path))
+ {
+ chrome_path = FindChromePath();
+ if (!string.IsNullOrEmpty(chrome_path))
+ Console.WriteLine ($"** Using chrome from {chrome_path}");
+ else
+ throw new Exception("Could not find an installed Chrome to use");
+ }
- foreach (var s in PROBE_LIST)
+ return chrome_path;
+
+ string FindChromePath()
{
- if (File.Exists(s))
+ string chrome_path_env_var = Environment.GetEnvironmentVariable("CHROME_PATH_FOR_DEBUGGER_TESTS");
+ if (!string.IsNullOrEmpty(chrome_path_env_var))
{
- chrome_path = s;
- Console.WriteLine($"Using chrome path: ${s}");
- return s;
+ if (File.Exists(chrome_path_env_var))
+ return chrome_path_env_var;
+
+ Console.WriteLine ($"warning: Could not find CHROME_PATH_FOR_DEBUGGER_TESTS={chrome_path_env_var}");
}
+
+ return PROBE_LIST.FirstOrDefault(p => File.Exists(p));
}
- throw new Exception("Could not find an installed Chrome to use");
}
public DebuggerTestBase(string driver = "debugger-driver.html")
@@ -90,7 +114,7 @@ public DebuggerTestBase(string driver = "debugger-driver.html")
cli = insp.Client;
scripts = SubscribeToScripts(insp);
- startTask = TestHarnessProxy.Start(FindChromePath(), DebuggerTestAppPath, driver);
+ startTask = TestHarnessProxy.Start(GetChromePath(), DebuggerTestAppPath, driver);
}
public virtual async Task InitializeAsync()
@@ -148,7 +172,7 @@ internal Dictionary SubscribeToScripts(Inspector insp)
}
internal async Task CheckInspectLocalsAtBreakpointSite(string url_key, int line, int column, string function_name, string eval_expression,
- Action test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false)
+ Func test_fn = null, Func wait_for_event_fn = null, bool use_cfo = false)
{
UseCallFunctionOnBeforeGetProperties = use_cfo;
@@ -171,10 +195,10 @@ await EvaluateAndCheck(
else
await Task.CompletedTask;
},
- locals_fn: (locals) =>
+ locals_fn: async (locals) =>
{
if (test_fn != null)
- test_fn(locals);
+ await test_fn(locals);
}
);
}
@@ -436,7 +460,7 @@ internal async Task InvokeGetter(JToken obj, object arguments, string fn
}
internal async Task StepAndCheck(StepKind kind, string script_loc, int line, int column, string function_name,
- Func wait_for_event_fn = null, Action locals_fn = null, int times = 1)
+ Func wait_for_event_fn = null, Func locals_fn = null, int times = 1)
{
string method = (kind == StepKind.Resume ? "Debugger.resume" : $"Debugger.step{kind}");
for (int i = 0; i < times - 1; i++)
@@ -451,15 +475,17 @@ internal async Task StepAndCheck(StepKind kind, string script_loc, int
locals_fn: locals_fn);
}
- internal async Task EvaluateAndCheck(string expression, string script_loc, int line, int column, string function_name,
- Func wait_for_event_fn = null, Action locals_fn = null) => await SendCommandAndCheck(
- JObject.FromObject(new { expression = expression }),
- "Runtime.evaluate", script_loc, line, column, function_name,
- wait_for_event_fn: wait_for_event_fn,
- locals_fn: locals_fn);
+ internal async Task EvaluateAndCheck(
+ string expression, string script_loc, int line, int column, string function_name,
+ Func wait_for_event_fn = null, Func locals_fn = null)
+ => await SendCommandAndCheck(
+ JObject.FromObject(new { expression = expression }),
+ "Runtime.evaluate", script_loc, line, column, function_name,
+ wait_for_event_fn: wait_for_event_fn,
+ locals_fn: locals_fn);
internal async Task SendCommandAndCheck(JObject args, string method, string script_loc, int line, int column, string function_name,
- Func wait_for_event_fn = null, Action locals_fn = null, string waitForEvent = Inspector.PAUSE)
+ Func wait_for_event_fn = null, Func locals_fn = null, string waitForEvent = Inspector.PAUSE)
{
var res = await cli.SendCommand(method, args, token);
if (!res.IsOk)
@@ -486,7 +512,7 @@ internal async Task SendCommandAndCheck(JObject args, string method, st
var locals = await GetProperties(wait_res["callFrames"][0]["callFrameId"].Value());
try
{
- locals_fn(locals);
+ await locals_fn(locals);
}
catch (System.AggregateException ex)
{
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj
index a46fd059b01fe9..90e236ceb5b520 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj
@@ -16,7 +16,18 @@
-
+
+
+
+
+ <_FilesToCopy Include="$(OutputPath)\**\*" TargetPath="DebuggerTestSuite" />
+ <_FilesToCopy Include="$(ArtifactsBinDir)debugger-test\Debug\**\*" TargetPath="debugger-test" />
+
+
+
+
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs
index 8919f4a6ee1e40..e1ed977ae52e96 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/ExceptionTests.cs
@@ -235,6 +235,7 @@ await CheckValue(pause_location["data"], JObject.FromObject(new
[Theory]
[InlineData("[debugger-test] DebuggerTests.ExceptionTestsClassDefault:TestExceptions", "System.Exception", 76)]
[InlineData("[debugger-test] DebuggerTests.ExceptionTestsClass:TestExceptions", "DebuggerTests.CustomException", 28)]
+ [Trait("Category", "linux-failing")] // https://github.com/dotnet/runtime/issues/62666
public async Task ExceptionTestAllWithReload(string entry_method_name, string class_name, int line_number)
{
var debugger_test_loc = "dotnet://debugger-test.dll/debugger-exception-test.cs";
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/HarnessTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/HarnessTests.cs
index ef36ace6624a16..865eaa8c630f5e 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/HarnessTests.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/HarnessTests.cs
@@ -36,8 +36,13 @@ public async Task BrowserCrash() => await Assert.ThrowsAsync
await SendCommandAndCheck(null, "Browser.crash", null, -1, -1, null));
[Fact]
- public async Task BrowserClose() => await Assert.ThrowsAsync(async () =>
- await SendCommandAndCheck(null, "Browser.close", null, -1, -1, null));
+ public async Task BrowserClose()
+ {
+ ArgumentException ae = await Assert.ThrowsAsync(async () =>
+ await SendCommandAndCheck(null, "Browser.close", null, -1, -1, null));
+ Assert.Contains("Inspector.detached", ae.Message);
+ Assert.Contains("target_close", ae.Message);
+ }
[Fact]
public async Task InspectorWaitForAfterMessageAlreadyReceived()
diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs
index 826d860c21e4d4..616349e3385317 100644
--- a/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs
+++ b/src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs
@@ -42,7 +42,11 @@ public Inspector()
Token = _cancellationTokenSource.Token;
_loggerFactory = LoggerFactory.Create(builder =>
- builder.AddSimpleConsole(options => options.SingleLine = true)
+ builder.AddSimpleConsole(options =>
+ {
+ options.SingleLine = true;
+ options.TimestampFormat = "[HH:mm:ss] ";
+ })
.AddFilter(null, LogLevel.Trace));
Client = new InspectorClient(_loggerFactory.CreateLogger());
@@ -175,6 +179,7 @@ async Task OnMessage(string method, JObject args, CancellationToken token)
}
else if (fail)
{
+ args["__forMethod"] = method;
FailAllWaiters(new ArgumentException(args.ToString()));
}
}
@@ -198,7 +203,7 @@ public async Task OpenSessionAsync(Func
+ test_fn: async (locals) =>
{
CheckNumber(locals, "a", 10);
CheckNumber(locals, "b", 20);
CheckNumber(locals, "c", 30);
CheckNumber(locals, "d", 0);
CheckNumber(locals, "e", 0);
+ await Task.CompletedTask;
}
);
@@ -81,10 +81,11 @@ public async Task InspectPrimitiveTypeLocalsAtBreakpointSite() =>
await CheckInspectLocalsAtBreakpointSite(
"dotnet://debugger-test.dll/debugger-test.cs", 154, 8, "PrimitiveTypesTest",
"window.setTimeout(function() { invoke_static_method ('[debugger-test] Math:PrimitiveTypesTest'); }, 1);",
- test_fn: (locals) =>
+ test_fn: async (locals) =>
{
CheckSymbol(locals, "c0", "8364 '€'");
CheckSymbol(locals, "c1", "65 'A'");
+ await Task.CompletedTask;
}
);
@@ -94,7 +95,7 @@ await CheckInspectLocalsAtBreakpointSite(
"dotnet://debugger-test.dll/debugger-test2.cs", 50, 8, "Types",
"window.setTimeout(function() { invoke_static_method (\"[debugger-test] Fancy:Types\")(); }, 1);",
use_cfo: false,
- test_fn: (locals) =>
+ test_fn: async (locals) =>
{
CheckNumber(locals, "dPI", Math.PI);
CheckNumber(locals, "fPI", (float)Math.PI);
@@ -116,6 +117,7 @@ await CheckInspectLocalsAtBreakpointSite(
CheckNumber(locals, "sMin", short.MinValue);
CheckNumber(locals, "usMin", ushort.MinValue);
CheckNumber(locals, "usMax", ushort.MaxValue);
+ await Task.CompletedTask;
}
);
@@ -199,7 +201,7 @@ await CheckInspectLocalsAtBreakpointSite(
"dotnet://debugger-test.dll/debugger-test.cs", 74, 8, "GenericTypesTest",
"window.setTimeout(function() { invoke_generic_types_test (); }, 1);",
use_cfo: use_cfo,
- test_fn: (locals) =>
+ test_fn: async (locals) =>
{
CheckObject(locals, "list", "System.Collections.Generic.Dictionary