Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid special casing work items in sendtohelixhelp.proj #46315

Closed
wants to merge 11 commits into from
22 changes: 2 additions & 20 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@
<HelixCorrelationPayload Include="chromedriver" Uri="$(SeleniumUrl)" Condition="'$(TargetOS)' == 'Browser'" />

<_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'" />

<HelixWorkItem Include="@(_WorkItem -> '%(FileName)')">
<PayloadArchive>%(Identity)</PayloadArchive>
Expand All @@ -250,26 +252,6 @@
</HelixWorkItem>
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' != 'WasmTestOnBrowser'">
<!-- Create a work item for run-only WASM console app -->
<_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/console/*.zip" />
<HelixWorkItem Include="@(_RunOnlyWorkItem -> '%(FileName)')" >
<PayloadArchive>%(Identity)</PayloadArchive>
<!-- No RunTests script generated for the sample project so we just use the direct command -->
<Command>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</Command>
</HelixWorkItem>
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(Scenario)' == 'WasmTestOnBrowser'">
<!-- Create a work item for run-only WASM browser app -->
<_RunOnlyWorkItem Include="$(TestArchiveRoot)runonly/**/browser/*.zip" />
<HelixWorkItem Include="@(_RunOnlyWorkItem -> '%(FileName)')" >
<PayloadArchive>%(Identity)</PayloadArchive>
<!-- No RunTests script generated for the sample project so we just use the direct command -->
<Command>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</Command>
</HelixWorkItem>
</ItemGroup>

<Message Condition="'$(Scenario)' != ''" Importance="High" Text="Done building Helix work items for scenario $(Scenario). Work item count: @(_WorkItem->Count())" />
<Message Condition="'$(Scenario)' == '' and ('$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS')" Importance="High" Text="Done building Helix work items. Work item count: @(XHarnessAppBundleToTest->Count())" />
<Message Condition="'$(Scenario)' == '' and '$(TargetOS)' != 'Android' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'" Importance="High" Text="Done building Helix work items. Work item count: @(_WorkItem->Count())" />
Expand Down
13 changes: 13 additions & 0 deletions src/mono/netcore/sample/wasm/browser/WasmSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@
</Content>
</ItemGroup>

<Target Name="PrepareRunScript" BeforeTargets="CopySampleAppToHelixTestDir" Condition="'$(ArchiveTests)' == 'true'" >
Copy link
Member

Choose a reason for hiding this comment

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

We can do the same as we did for the console sample, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'll push that one up too.

<PropertyGroup>
<RunScriptCommand>
$HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --browser=Chrome --html-file=index.html --output-directory=$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output -- WasmSample.dll --testing
</RunScriptCommand>
</PropertyGroup>

<MSBuild Projects="$(RepoRoot)eng/testing/tests.targets"
Condition="'$(ArchiveTests)' == 'true'"
Properties="OutDir=$(AppDir);RunScriptInputPath=$(RepoRoot)eng/testing/WasmRunnerTemplate.sh;InstallerTasksAssemblyPath=$(RepoRoot)artifacts/obj/installer.tasks/Debug/netstandard2.0/installer.tasks.dll;RunScriptCommand=$(RunScriptCommand)"
Targets="GenerateRunScript" />
</Target>

<Target Name="CopySampleAppToHelixTestDir"
Condition="'$(ArchiveTests)' == 'true'"
AfterTargets="Build"
Expand Down
12 changes: 10 additions & 2 deletions src/mono/netcore/sample/wasm/console/WasmSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<RunAOTCompilation Condition="'$(RunAOTCompilation)' == ''">false</RunAOTCompilation>
<RunAnalyzers>false</RunAnalyzers>
<JSEngine>V8</JSEngine>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
Expand All @@ -26,6 +27,12 @@
<DebuggerSupport>false</DebuggerSupport>
</PropertyGroup>

<PropertyGroup Condition="'$(ArchiveTests)' == 'true'">
<RunScriptCommand>
$HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run $(AssemblyName).dll
</RunScriptCommand>
</PropertyGroup>

<!-- Redirect 'dotnet publish' to in-tree runtime pack -->
<Target Name="TrickRuntimePackLocation" AfterTargets="ProcessFrameworkReferences">
<ItemGroup>
Expand Down Expand Up @@ -56,7 +63,7 @@
<Target Name="CopySampleAppToHelixTestDir"
Condition="'$(ArchiveTests)' == 'true'"
AfterTargets="Build"
DependsOnTargets="Publish" >
DependsOnTargets="GenerateRunScript;Publish" >
<PropertyGroup>
<!-- Helix properties -->
<!-- AnyCPU as Platform-->
Expand All @@ -70,5 +77,6 @@
<Copy SourceFiles="$(ZippedApp)" DestinationFolder="$(HelixArchiveRunOnlyAppsDir)" />
</Target>

<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.targets" />
<Import Condition="'$(ArchiveTests)' == 'true'" Project="$(RepoRoot)eng/testing/tests.targets" />
<Import Condition="'$(ArchiveTests)' != 'true'" Project="$(MonoProjectRoot)\wasm\build\WasmApp.targets" />
</Project>