Skip to content

Commit

Permalink
[wasm] Run browser tests on helix/windows (#52699)
Browse files Browse the repository at this point in the history
* [wasm] Run browser tests on helix/windows

* Build just wasm/browsertests on helix/windows

* Use $(ChromiumRevision) in windows links

* Fix conditions

* Set PATH differently

* Use backslash in PATH on windows

* Try different version of chromium

* Pass scenario and browser host to build

And set browser path on windows to be able to start chrome
from xharness

* Try to get more info from the helix workitems

* Fix dir separator, add broser path

* Create WasmBuildSupportDir

* Revert "Try to get more info from the helix workitems"

This reverts commit 8807434.

* Put the dir cmds back, fix mkdir call

* More debug info

* Bump xharness

* Bump xharness again

With darc this time

* StressLogAnalyzer didn't print the number of messages correctly if it exceeded the int range (2 billion). (#54832)

Fix is to just use 64 bit ints instead.

* Found a race condition where the LOH flag on a segment is set too late. This gives another thread the chance to allocate in a fresh LOH region that doesn't have the LOH flag set just yet and trip over an assert in Object::ValidateInner. (#54839)

The fix is simply to set the flag in get_new_region before the region is put on the list for the LOH generation.

* Try to show the chrome logs

* Use different path for chrome logs

* Use newer image with font for chrome

The chrome was crashing, because it didn't find any sans-serif font.

* Increase timeouts

* Disable tests which timeout

* Remove debug calls

* Put back normal scenario

* Do not set scenario in build args

* Add browser sample exclusion

* Restore the platform matrix

* Remove the wasm build test changes

That will be handled in #54451

* Remove duplicate exclusion

* Suggested property name change

* Fix last merge

* Simplify condition

We don't pass Scenario anymore

* Include chrome and chromedriver in the payload

Co-authored-by: Peter Sollich <petersol@microsoft.com>
  • Loading branch information
radekdoulik and PeterSolMS committed Jul 19, 2021
1 parent 62fad9d commit a587fa4
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ jobs:

# WebAssembly windows
- ${{ if eq(parameters.platform, 'Browser_wasm_win') }}:
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210531091615-f5c7a43
- (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-webassembly-amd64-20210702131541-6837048

${{ insert }}: ${{ parameters.jobParameters }}
5 changes: 3 additions & 2 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jobs:
timeoutInMinutes: 90

#
# Build Browser_wasm, on windows
# Build Browser_wasm, on windows, run console and browser tests
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
Expand All @@ -374,7 +374,7 @@ jobs:
testGroup: innerloop
nameSuffix: Browser_wasm_Windows
buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows
timeoutInMinutes: 120
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
Expand All @@ -389,6 +389,7 @@ jobs:
extraHelixArguments: /p:BrowserHost=windows
scenarios:
- normal
- wasmtestonbrowser
condition: >-
or(
eq(variables['librariesContainsChange'], true),
Expand Down
1 change: 1 addition & 0 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<_XHarnessArgs Condition="'$(OS)' == 'Windows_NT'">wasm %XHARNESS_COMMAND% --app=. --output-directory=%XHARNESS_OUT%</_XHarnessArgs>

<_XHarnessArgs Condition="'$(Scenario)' != 'WasmTestOnBrowser'">$(_XHarnessArgs) --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js</_XHarnessArgs>
<_XHarnessArgs Condition="'$(BrowserHost)' == 'windows'">$(_XHarnessArgs) --browser=chrome --browser-path=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe</_XHarnessArgs>
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)</_XHarnessArgs>
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)</_XHarnessArgs>

Expand Down
29 changes: 21 additions & 8 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == '' and '$(Outerloop)' == 'true'">00:20:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == '' and '$(_workItemTimeout)' == ''">00:15:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' != '' and '$(_workItemTimeout)' == ''">00:30:00</_workItemTimeout>
<_workItemTimeout Condition="'$(Scenario)' == 'wasmtestonbrowser' and '$(BrowserHost)' == 'windows'">00:45:00</_workItemTimeout>

<!-- The Helix runtime payload and the tests to run -->
<!-- TestArchiveRuntimeFile will be passed as a property by the calling project -->
Expand Down Expand Up @@ -110,6 +111,10 @@
<HelixPreCommand Include="export PATH=$HELIX_CORRELATION_PAYLOAD/chromedriver_linux64:$PATH" />
<HelixPreCommand Include="export PATH=$HELIX_CORRELATION_PAYLOAD/chrome-linux:$PATH" />
</ItemGroup>
<ItemGroup Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(WindowsShell)' == 'true'">
<HelixPreCommand Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\chromedriver_win32%3B%PATH%" />
<HelixPreCommand Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\chrome-win%3B%PATH%" />
</ItemGroup>

<Choose>
<When Condition="'$(NeedsWorkload)' == 'true'">
Expand Down Expand Up @@ -308,18 +313,25 @@
</ItemGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- Version number to revision number mapping from http://omahaproxy.appspot.com/ -->
<!-- 84.0.4147.105 is 768962 for example -->
<ChromiumRevision>768968</ChromiumRevision>
<ChromiumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chrome-linux.zip</ChromiumUrl>
<ChromeDriverUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip</ChromeDriverUrl>
<EmSdkDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDir>
<WasmBuildTargetsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'build'))</WasmBuildTargetsDir>
<TestEchoMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(NetCoreAppCurrent)-$(Configuration)'))</TestEchoMiddleware>
<RemoteLoopMiddleware>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(NetCoreAppCurrent)-$(Configuration)'))</RemoteLoopMiddleware>
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' == 'true'">Workloads-</WorkItemPrefix>
<WorkItemPrefix Condition="'$(Scenario)' == 'BuildWasmApps' and '$(TestUsingWorkloads)' != 'true'">EMSDK-</WorkItemPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser' and '$(BrowserHost)' != 'windows'">
<!-- Version number to revision number mapping from http://omahaproxy.appspot.com/ -->
<!-- 84.0.4147.105 is 768962 for example -->
<ChromiumRevision>768968</ChromiumRevision>
<ChromiumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chrome-linux.zip</ChromiumUrl>
<ChromeDriverUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip</ChromeDriverUrl>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser' and '$(BrowserHost)' == 'windows'">
<ChromiumRevision>768983</ChromiumRevision>
<ChromiumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chrome-win.zip</ChromiumUrl>
<ChromeDriverUrl>https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chromedriver_win32.zip</ChromeDriverUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono'">
<_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross'))</_MonoAotCrossCompilerPath>
Expand Down Expand Up @@ -369,8 +381,8 @@
<HelixCorrelationPayload Include="$(HelixCorrelationPayload)"
Condition="'$(IncludeHelixCorrelationPayload)' == 'true' and '$(TargetOS)' != 'Browser'"
AsArchive="$(HelixCorrelationPayload.EndsWith('.zip'))" />
<HelixCorrelationPayload Include="chromium" Uri="$(ChromiumUrl)" Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(BrowserHost)' != 'windows'" />
<HelixCorrelationPayload Include="chromedriver" Uri="$(ChromeDriverUrl)" Condition="'$(NeedsToRunOnBrowser)' == 'true' and '$(BrowserHost)' != 'windows'" />
<HelixCorrelationPayload Include="chromium" Uri="$(ChromiumUrl)" Condition="'$(NeedsToRunOnBrowser)' == 'true'" />
<HelixCorrelationPayload Include="chromedriver" Uri="$(ChromeDriverUrl)" Condition="'$(NeedsToRunOnBrowser)' == 'true'" />

<_WorkItem Include="$(WorkItemArchiveWildCard)" Exclude="$(HelixCorrelationPayload)" />
<_WorkItem Include="$(TestArchiveRoot)runonly/**/WebAssembly.Console.*.Test.zip" Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' != 'WasmTestOnBrowser' and '$(Scenario)' != 'BuildWasmApps'" />
Expand All @@ -393,6 +405,7 @@
<ExecXHarnessCmd>dotnet exec %XHARNESS_CLI_PATH%</ExecXHarnessCmd>
<XHarnessOutput>%HELIX_WORKITEM_UPLOAD_ROOT%\xharness-output</XHarnessOutput>
<XHarnessCommand>%XHARNESS_COMMAND%</XHarnessCommand>
<XHarnessBrowserPathArg>--browser-path=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe</XHarnessBrowserPathArg>
</PropertyGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' != 'WasmTestOnBrowser' and '$(Scenario)' != 'BuildWasmApps'">
Expand All @@ -411,7 +424,7 @@
<HelixWorkItem Include="@(_RunOnlyWorkItem -> '%(FileName)')" >
<PayloadArchive>%(Identity)</PayloadArchive>
<!-- No RunTests script generated for the sample project so we just use the direct command -->
<Command>$(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --browser=Chrome --html-file=index.html --output-directory=$(XHarnessOutput) -- %(FileName).dll --testing</Command>
<Command>$(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- %(FileName).dll --testing</Command>
</HelixWorkItem>
</ItemGroup>

Expand Down
12 changes: 12 additions & 0 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,18 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Compression.ZipFile\tests\System.IO.Compression.ZipFile.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\Xslt\XslCompiledTransformApi\System.Xml.Xsl.XslCompiledTransformApi.Tests.csproj" />
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\console\Wasm.Console.Sample.csproj" />
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\browser\Wasm.Browser.Sample.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(BrowserHost)' == 'windows' and '$(Scenario)' == 'WasmTestOnBrowser' and '$(RunDisabledWasmTestsOnWindows)' != 'true'">
<!-- Issue: https://github.com/dotnet/runtime/issues/55429 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.VisualBasic.Core\tests\Microsoft.VisualBasic.Core.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO\tests\System.IO.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Expressions\tests\System.Linq.Expressions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Memory\tests\System.Memory.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\Writers\XmlWriterApi\System.Xml.RW.XmlWriterApi.Tests.csproj" />
<ProjectExclusions Include="$(RepoRoot)\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'OSX' and '$(TargetArchitecture)' == 'arm64' and '$(RunDisabledAppleSiliconTests)' != 'true'">
Expand Down

0 comments on commit a587fa4

Please sign in to comment.