Skip to content

Commit

Permalink
[wasm] Move src/tests/BuildWasmApps/* to src/mono/wasm (#74698)
Browse files Browse the repository at this point in the history
- This will help simplifying the path subsets in
`eng/pipelines/common/evaluate-default-paths.yml`, which would then help
to avoid a lot of unrelated non-wasm builds on PRs
  • Loading branch information
radical committed Aug 29, 2022
1 parent ca92d88 commit ba3ee97
Show file tree
Hide file tree
Showing 102 changed files with 50 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
/src/mono/nuget/*Workload.Mono.Toolchain*/ @lewing @radical
/src/mono/nuget/*MonoAOTCompiler*/ @lewing @radical

/src/tests/BuildWasmApps/ @radical
/src/mono/wasm/Wasm* @radical
/src/mono/wasm/testassets @radical
/src/tasks/WasmAppBuilder/ @radical
/src/tasks/WorkloadBuildTasks/ @radical
/src/tasks/AotCompilerTask/ @radical
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/testing/testing-workloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Example for wasm:
VersionBand="$(SdkBandVersion)" />
```

- Currently, this is used only by `src/tests/BuildWasmApps/Wasm.Build.Tests`
- Currently, this is used only by `src/mono/wasm/Wasm.Build.Tests`

## Multiple runtime packs

Expand Down
10 changes: 5 additions & 5 deletions eng/pipelines/common/evaluate-default-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
exclude:
# wasm runtime changes will trigger all wasm jobs anyway
- src/mono/wasm/*
- src/tests/BuildWasmApps/*
- src/mono/wasm/*
- eng/pipelines/common/evaluate-default-paths.yml
- subset: installer
include:
Expand Down Expand Up @@ -116,8 +116,8 @@ jobs:
- subset: wasmbuildtests
include:
- src/tasks/*
- src/tests/BuildWasmApps/Directory.Build*
- src/tests/BuildWasmApps/Wasm.Build.Tests/*
- src/mono/wasm/Directory.Build*
- src/mono/wasm/Wasm.Build.Tests/*
- src/mono/wasm/build/*
- src/mono/wasm/host/*
- src/mono/wasm/runtime/*
Expand All @@ -141,8 +141,8 @@ jobs:
include:
- src/mono/wasm/debugger/*
- src/mono/wasm/runtime/*
- src/tests/BuildWasmApps/Directory.Build*
- src/tests/BuildWasmApps/Wasm.Debugger.Tests/*
- src/mono/wasm/Directory.Build*
- src/mono/wasm/debugger/Wasm.Debugger.Tests/*
- eng/testing/ProvisioningVersions.props
- src/mono/mono/*
exclude:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
/p:Configuration=${{ parameters.configForBuild }}
/p:ContinuousIntegrationBuild=true
/t:InstallWorkloadUsingArtifacts
$(Build.SourcesDirectory)/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj
$(Build.SourcesDirectory)/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj
displayName: "Install workload using artifacts"
- script: >-
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,14 @@
<ProjectReference Include="@(TrimmingTestProjects)" />

<!-- wasm.build.tests are run on _WasmBuildTests job on CI, and with library tests locally. -->
<ProjectReference Include="$(RepoRoot)\src\tests\BuildWasmApps\Wasm.Build.Tests\*.Tests.csproj"
<ProjectReference Include="$(RepoRoot)\src\mono\wasm\Wasm.Build.Tests\*.Tests.csproj"
Exclude="@(ProjectExclusions)"
Condition="'$(TargetOS)' == 'Browser' and
(('$(ContinuousIntegrationBuild)' == 'true' and '$(TestWasmBuildTests)' == 'true') or
('$(ContinuousIntegrationBuild)' != 'true' and '$(TestAssemblies)' == 'true'))"
BuildInParallel="false" />

<ProjectReference Include="$(RepoRoot)\src\tests\BuildWasmApps\Wasm.Debugger.Tests\*.Tests.csproj"
<ProjectReference Include="$(RepoRoot)\src\mono\wasm\debugger\Wasm.Debugger.Tests\*.Tests.csproj"
Exclude="@(ProjectExclusions)"
Condition="'$(TargetOS)' == 'Browser' and
(('$(ContinuousIntegrationBuild)' == 'true' and '$(TestWasmDebuggerTests)' == 'true') or
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ run-tests-%:
EMSDK_PATH=$(EMSDK_PATH) PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)

run-build-tests:
PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/tests/BuildWasmApps/Wasm.Build.Tests/ /t:Test $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)
PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/mono/wasm//Wasm.Build.Tests/ /t:Test $(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)

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 \
$(TOP)/src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj \
$(_MSBUILD_WASM_BUILD_ARGS) $(MSBUILD_ARGS)

submit-debugger-tests-helix: build-debugger-tests-helix
Expand Down
10 changes: 10 additions & 0 deletions src/mono/wasm/Wasm.Build.Tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<!-- needs to be set early -->
<Scenario>BuildWasmApps</Scenario>
<IsTestProject>true</IsTestProject>
<AssemblyBeingTested>Wasm.Build.Tests</AssemblyBeingTested>
</PropertyGroup>

<Import Project="..\..\..\libraries\Directory.Build.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<Import Project="..\..\libraries\Directory.Build.targets" />
<Import Project="..\..\..\libraries\Directory.Build.targets" />

<PropertyGroup>
<BundleDir>$(OutDir)</BundleDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ being generated.
- Running:

Linux/macOS: `$ make -C src/mono/wasm run-build-tests`
Windows: `.\dotnet.cmd build .\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj -c Release -t:Test -p:TargetOS=Browser -p:TargetArchitecture=wasm`
Windows: `.\dotnet.cmd build .\src\mono\wasm\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj -c Release -t:Test -p:TargetOS=Browser -p:TargetArchitecture=wasm`

- Specific tests can be run via `XUnitClassName`, and `XUnitMethodName`
- eg. `XUnitClassName=Wasm.Build.Tests.BlazorWasmTests`
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<ProjectReference Include="..\BrowserDebugHost\BrowserDebugHost.csproj" />
<ProjectReference Include="..\BrowserDebugProxy\BrowserDebugProxy.csproj" />
<ProjectReference Include="..\tests\debugger-test\debugger-test.csproj" ReferenceOutputAssembly="false" Private="false" />
<ProjectReference Include="..\tests\debugger-test\debugger-test.csproj" AdditionalProperties="RuntimeConfiguration=Release" ReferenceOutputAssembly="false" Private="false" />

<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
<!-- needed for ConditionalFact etc -->
Expand Down
5 changes: 5 additions & 0 deletions src/mono/wasm/debugger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
## Debug proxy

- Protocol messages are truncated when logged, to 64k, by default. But this can be changed by setting `WASM_DONT_TRUNCATE_LOG_MESSAGES=1`.

## Projects

- `DebuggerTestSuite` - project with all the tests, and the test harness
- `Wasm.Debugger.Tests` - a wrapper project to fit in the global build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<Import Project="..\..\..\..\libraries\Directory.Build.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<Import Project="..\..\..\..\libraries\Directory.Build.targets" />

<PropertyGroup>
<BundleDir>$(OutDir)</BundleDir>
<RunScriptOutputPath Condition="'$(OS)' != 'Windows_NT'">$(OutDir)\RunTests.sh</RunScriptOutputPath>
<RunScriptOutputPath Condition="'$(OS)' == 'Windows_NT'">$(OutDir)\RunTests.cmd</RunScriptOutputPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj"
<ProjectReference Include="../DebuggerTestSuite/DebuggerTestSuite.csproj"
ReferenceOutputAssembly="false"
Private="false"
GlobalPropertiesToRemove="TargetFramework;TargetFrameworks;Configuration;TargetOS;TargetArchitecture"
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/runtime/workers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ Some other places that may need to be modified include:
* `eng/liveBuilds.targets`
* `src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.prop`
* [`../../build/WasmApp.targets`](../../build/WasmApp.targets)
* `src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs`
* `src/mono/wasm//Wasm.Build.Tests/BuildTestBase.cs`
* etc

2 changes: 1 addition & 1 deletion src/mono/wasm/sln/WasmBuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WasmAppBuilder", "..\..\..\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoAOTCompiler", "..\..\..\tasks\AotCompilerTask\MonoAOTCompiler.csproj", "{A9C02284-0387-42E7-BF78-47DF13656D5E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wasm.Build.Tests", "..\..\..\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj", "{94E18644-B0E5-4DBB-9CE4-EA1515ACE4C2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wasm.Build.Tests", "..\Wasm.Build.Tests\Wasm.Build.Tests.csproj", "{94E18644-B0E5-4DBB-9CE4-EA1515ACE4C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DebuggerTestSuite", "..\debugger\DebuggerTestSuite\DebuggerTestSuite.csproj", "{4C0EE027-FC30-4167-B2CF-A6D18F00E08F}"
EndProject
Expand Down
File renamed without changes
File renamed without changes.
3 changes: 0 additions & 3 deletions src/tests/BuildWasmApps/Directory.Build.props

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/tests/Common/dirs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<DisabledProjects Include="$(TestRoot)*\**\cs_template.csproj" />
<DisabledProjects Include="$(TestRoot)Common\**\*.*proj" />
<DisabledProjects Include="$(TestRoot)FunctionalTests\**\*.csproj" /> <!-- They need to be isolated from the existing setup -->
<DisabledProjects Include="$(TestRoot)BuildWasmApps\**\*.csproj" /> <!-- built and run with libraries -->
<DisabledProjects Include="$(TestRoot)GC\Performance\Framework\GCPerfTestFramework.csproj" />
<DisabledProjects Include="$(TestRoot)Loader\classloader\StaticVirtualMethods\**\generatetest.csproj" /> <!-- test generators -->
<DisabledProjects Include="$(TestRoot)Performance\Scenario\JitBench\unofficial_dotnet\JitBench.csproj" /> <!-- no official build support for SDK-style netcoreapp2.0 projects -->
Expand Down

0 comments on commit ba3ee97

Please sign in to comment.