From 0c122fe020f218575ba7446e2edff5a774de0228 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 22 Dec 2020 11:45:47 +0300 Subject: [PATCH 1/6] Use run script for wasm console sample --- src/libraries/sendtohelixhelp.proj | 10 ---------- .../sample/wasm/console/WasmSample.csproj | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 6f29d17ebe4ef..32d3dc3749780 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -250,16 +250,6 @@ - - - <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/console/*.zip" /> - - %(Identity) - - dotnet exec $XHARNESS_CLI_PATH wasm $XHARNESS_COMMAND --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --js-file=runtime.js --output-directory=$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output -- --run WasmSample.dll - - - <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/browser/*.zip" /> diff --git a/src/mono/netcore/sample/wasm/console/WasmSample.csproj b/src/mono/netcore/sample/wasm/console/WasmSample.csproj index 6cd0bd9c5b52d..9661278a37730 100644 --- a/src/mono/netcore/sample/wasm/console/WasmSample.csproj +++ b/src/mono/netcore/sample/wasm/console/WasmSample.csproj @@ -53,6 +53,19 @@ + + + + TEST_NAME=WasmConsoleSample%0aTARGET_OS=Browser%0aTARGET_ARCH=wasm%0a$HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=V8 $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll + + + + + + $(TargetOS).AnyCPU.$(Configuration) $(ArtifactsDir)helix/ - $(HelixArchiveRoot)runonly/ - $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/console/ $(OutputPath)/WasmConsoleSample.zip - + From e9d4bf43c9031c8ba424ad947b7d4cb9fcc76fbb Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 22 Dec 2020 16:31:13 +0300 Subject: [PATCH 2/6] Update wasm samples to use run script --- src/libraries/sendtohelixhelp.proj | 10 ++++++++-- .../netcore/sample/wasm/browser/WasmSample.csproj | 13 +++++++++++++ .../netcore/sample/wasm/console/WasmSample.csproj | 7 +++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 32d3dc3749780..7f814136d5546 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -250,13 +250,19 @@ + + + <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/console/*.zip" /> + + %(Identity) + + + <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/browser/*.zip" /> %(Identity) - - dotnet exec $XHARNESS_CLI_PATH wasm $XHARNESS_COMMAND --app=. --browser=Chrome --html-file=index.html --output-directory=$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output -- WasmSample.dll --testing diff --git a/src/mono/netcore/sample/wasm/browser/WasmSample.csproj b/src/mono/netcore/sample/wasm/browser/WasmSample.csproj index 4f92851ca314e..1160da4647c91 100644 --- a/src/mono/netcore/sample/wasm/browser/WasmSample.csproj +++ b/src/mono/netcore/sample/wasm/browser/WasmSample.csproj @@ -60,6 +60,19 @@ + + + + $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --browser=Chrome --html-file=index.html --output-directory=$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output -- WasmSample.dll --testing + + + + + + browser-wasm false false + V8 @@ -56,7 +57,7 @@ - TEST_NAME=WasmConsoleSample%0aTARGET_OS=Browser%0aTARGET_ARCH=wasm%0a$HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=V8 $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll + $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll @@ -75,10 +76,12 @@ $(TargetOS).AnyCPU.$(Configuration) $(ArtifactsDir)helix/ + $(HelixArchiveRoot)runonly/ + $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/console/ $(OutputPath)/WasmConsoleSample.zip - + From e81753c6542d1a45d6bab0020837053c5e3f05cc Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 23 Dec 2020 11:56:41 +0300 Subject: [PATCH 3/6] Get rid of the separate helix work items for wasm samples --- src/libraries/sendtohelixhelp.proj | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 7f814136d5546..d799082fcd3c2 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -242,6 +242,8 @@ <_WorkItem Include="$(WorkItemArchiveWildCard)" Exclude="$(HelixCorrelationPayload)" /> + <_WorkItem Include="$(TestArchiveRoot)runonly/**/console/*.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' != 'WasmTestOnBrowser'" /> + <_WorkItem Include="$(TestArchiveRoot)runonly/**/browser/*.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'" /> %(Identity) @@ -250,22 +252,6 @@ - - - <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/console/*.zip" /> - - %(Identity) - - - - - - <_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/browser/*.zip" /> - - %(Identity) - - - From 28e384540eaa4c11c2f2d1a9c272ec5d338c9e06 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 24 Dec 2020 12:51:11 +0300 Subject: [PATCH 4/6] Remove a space Co-authored-by: Santiago Fernandez Madero --- src/mono/netcore/sample/wasm/browser/WasmSample.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/netcore/sample/wasm/browser/WasmSample.csproj b/src/mono/netcore/sample/wasm/browser/WasmSample.csproj index 1160da4647c91..630aa9796d79d 100644 --- a/src/mono/netcore/sample/wasm/browser/WasmSample.csproj +++ b/src/mono/netcore/sample/wasm/browser/WasmSample.csproj @@ -67,7 +67,7 @@ - From 53c41060449ceb38436b01490674a1b1e56c8130 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 5 Jan 2021 17:44:41 -0500 Subject: [PATCH 5/6] Address santi feedback --- .../sample/wasm/console/WasmSample.csproj | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/mono/netcore/sample/wasm/console/WasmSample.csproj b/src/mono/netcore/sample/wasm/console/WasmSample.csproj index 987d6c79dcb84..bc8f7d4ccb682 100644 --- a/src/mono/netcore/sample/wasm/console/WasmSample.csproj +++ b/src/mono/netcore/sample/wasm/console/WasmSample.csproj @@ -27,6 +27,12 @@ false + + + $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll + + + @@ -54,23 +60,10 @@ - - - - $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll - - - - - - + DependsOnTargets="GenerateRunScript;Publish" > @@ -84,5 +77,6 @@ - + + From e0a40834534af6a702ba662fab82144a8352d191 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Mon, 11 Jan 2021 16:16:47 +0300 Subject: [PATCH 6/6] Fix targets --- eng/testing/tests.mobile.targets | 2 +- src/mono/netcore/sample/wasm/browser/Makefile | 2 +- .../wasm/browser/Wasm.Browser.Sample.csproj | 48 ++++++------------- src/mono/netcore/sample/wasm/console/Makefile | 4 +- .../wasm/console/Wasm.Console.Sample.csproj | 40 +++++----------- 5 files changed, 31 insertions(+), 65 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 9ac8dcc27879b..0e54e91e9ec54 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -222,5 +222,5 @@ AfterTargets="Build" DependsOnTargets="Publish;BundleTestAppleApp;BundleTestAndroidApp;BundleTestWasmApp;ArchiveTests" /> - + diff --git a/src/mono/netcore/sample/wasm/browser/Makefile b/src/mono/netcore/sample/wasm/browser/Makefile index 8a243d4432e21..e7314d5c7a308 100644 --- a/src/mono/netcore/sample/wasm/browser/Makefile +++ b/src/mono/netcore/sample/wasm/browser/Makefile @@ -26,5 +26,5 @@ run: echo "The tool dotnet-serve could not be found. Install with: $(DOTNET) tool install --global dotnet-serve"; \ exit 1; \ else \ - $(DOTNET) serve -d bin/$(CONFIG)/AppBundle -p 8000; \ + $(DOTNET) serve -d bin/browser-wasm/AppBundle -p 8000; \ fi diff --git a/src/mono/netcore/sample/wasm/browser/Wasm.Browser.Sample.csproj b/src/mono/netcore/sample/wasm/browser/Wasm.Browser.Sample.csproj index a5c3c52ede2ec..7ddbbe166d87e 100644 --- a/src/mono/netcore/sample/wasm/browser/Wasm.Browser.Sample.csproj +++ b/src/mono/netcore/sample/wasm/browser/Wasm.Browser.Sample.csproj @@ -15,6 +15,14 @@ $(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\ false false + $(TargetOS).AnyCPU.$(Configuration) + $(ArtifactsDir)helix/ + $(HelixArchiveRoot)runonly/ + $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)\browser\ + $(HelixArchiveRunOnlyAppsDir) + $(AssemblyName) + $(MSBuildProjectDirectory)\bin\browser-wasm\ + true @@ -36,9 +44,11 @@ - + + + - $(AppDir) + $(OutDir)\AppBundle\ $(MSBuildProjectDirectory)\$(PublishDir)\ runtime.js $(WasmBuildDir)$(AssemblyName).dll @@ -49,7 +59,7 @@ - + @@ -59,35 +69,5 @@ - - - - $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --browser=Chrome --html-file=index.html --output-directory=$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output -- WasmSample.dll --testing - - - - - - - - - - - $(TargetOS).AnyCPU.$(Configuration) - $(ArtifactsDir)helix/ - $(HelixArchiveRoot)runonly/ - $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/browser/ - $(OutputPath)$(AssemblyName).zip - - - - - - + diff --git a/src/mono/netcore/sample/wasm/console/Makefile b/src/mono/netcore/sample/wasm/console/Makefile index f07b4695d7f6c..bccc4a719e8a9 100644 --- a/src/mono/netcore/sample/wasm/console/Makefile +++ b/src/mono/netcore/sample/wasm/console/Makefile @@ -17,10 +17,10 @@ CONFIG?=Release all: build build: - EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) publish $(DOTNET_Q_ARGS) $(DOTNET_RUN_AOT_COMPILATION_ARGS) $(DOTNET_EXTRA_ARGS) /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG) $(MSBUILD_ARGS) Wasm.Console.Sample.csproj + EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) publish $(DOTNET_Q_ARGS) $(DOTNET_RUN_AOT_COMPILATION_ARGS) $(DOTNET_EXTRA_ARGS) /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG) $(MSBUILD_ARGS) WasmSample.csproj clean: rm -rf bin run: - cd bin/$(CONFIG)/AppBundle && ~/.jsvu/v8 --expose_wasm runtime.js -- $(DOTNET_MONO_LOG_LEVEL) --run Wasm.Console.Sample.dll + cd bin/browser-wasm/AppBundle && ~/.jsvu/v8 --expose_wasm runtime.js -- $(DOTNET_MONO_LOG_LEVEL) --run Wasm.Console.Sample.dll diff --git a/src/mono/netcore/sample/wasm/console/Wasm.Console.Sample.csproj b/src/mono/netcore/sample/wasm/console/Wasm.Console.Sample.csproj index b0f7250d512e8..041cd97e622f3 100644 --- a/src/mono/netcore/sample/wasm/console/Wasm.Console.Sample.csproj +++ b/src/mono/netcore/sample/wasm/console/Wasm.Console.Sample.csproj @@ -16,6 +16,14 @@ false false V8 + $(TargetOS).AnyCPU.$(Configuration) + $(ArtifactsDir)helix/ + $(HelixArchiveRoot)runonly/ + $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)\console\ + $(HelixArchiveRunOnlyAppsDir) + $(AssemblyName) + $(MSBuildProjectDirectory)\bin\browser-wasm\ + true @@ -27,12 +35,6 @@ false - - - $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll - - - @@ -43,9 +45,11 @@ - + + + - $(AppBundleDir) + $(OutDir)\AppBundle\ $(MSBuildProjectDirectory)\$(PublishDir)\ $(MonoProjectRoot)\wasm\runtime-test.js $(WasmBuildDir)$(AssemblyName).dll @@ -60,23 +64,5 @@ - - - - - $(TargetOS).AnyCPU.$(Configuration) - $(ArtifactsDir)helix/ - $(HelixArchiveRoot)runonly/ - $(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/console/ - $(OutputPath)$(AssemblyName).zip - - - - - - - + \ No newline at end of file