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

Add E2E tests for blazorwasm+workloads+aot #10688

Closed
wants to merge 23 commits into from

Conversation

radical
Copy link
Member

@radical radical commented May 20, 2021

  • builds a blazorwasm app with workload microsoft-net-sdk-blazorwebassembly-aot

@radical
Copy link
Member Author

radical commented May 20, 2021

Depends on dotnet/emsdk#19

@radical radical marked this pull request as draft May 20, 2021 01:05
@radical radical force-pushed the wasm-workloads-aot branch 4 times, most recently from 98019e5 to bbe9144 Compare May 21, 2021 17:07
@lewing
Copy link
Member

lewing commented May 21, 2021

tracking one of the issues dotnet/sdk#17790

@radical
Copy link
Member Author

radical commented May 21, 2021

The tests here install the workload with dotnet workload install .., but since all the tests are using the same dotnet installation (in artifacts), workload install "taints" the manifest, and packs/. Does it sound reasonable to make a fresh copy of the dotnet dir, for every workload test, to avoid this issue? Or is there a better way to test this here?

This would allow tests like:

  • build blazorwasm with no workload installed
  • using workload install when it is already installed

@sfoslund @lewing

@radical
Copy link
Member Author

radical commented May 22, 2021

Tests should fail while running emcc --version, because of dotnet/emsdk#19 .

@sfoslund
Copy link
Member

Does it sound reasonable to make a fresh copy of the dotnet dir, for every workload test, to avoid this issue? Or is there a better way to test this here?

This would be hugely costly and add a lot of time to our test runs. @wli3 do you have any suggestions for how to do this or if these tests are needed?

@radical
Copy link
Member Author

radical commented May 24, 2021

Does it sound reasonable to make a fresh copy of the dotnet dir, for every workload test, to avoid this issue? Or is there a better way to test this here?

This would be hugely costly and add a lot of time to our test runs. @wli3 do you have any suggestions for how to do this or if these tests are needed?

Just to be clear, I meant - make a copy of artifacts/bin/redist/Debug/dotnet/.

@radical
Copy link
Member Author

radical commented May 24, 2021

.. and this PR is now using local copies. AFAICS, that itself shouldn't affect run times much. But building for AOT will add some extra time.

Copy link

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

This looks great although I worry about the impact on the build time. FYI @wli3

test/EndToEnd/WorkloadTests.cs Outdated Show resolved Hide resolved
test/EndToEnd/WorkloadTests.cs Show resolved Hide resolved
+ sourceDirName);
}

DirectoryInfo[] dirs = dir.GetDirectories();

Choose a reason for hiding this comment

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

This can be done on Line 124. Also you could consider using EnumerateDirectories()

test/EndToEnd/WorkloadTests.cs Outdated Show resolved Hide resolved
DirectoryInfo directory = TestAssets.CreateTestDirectory();
WorkloadTestEnvironment env = PrepareTestEnvironment(directory.FullName);

//FIXME: poke the value in the project file

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

I want to set the property in the project file, instead of forcing it as a global property from the command line. That would be closest to what a user would do.


//FIXME: poke the value in the project file

// AOT builds are slow, so in case the test is failing (IOW, it is able to build)
Copy link

@wli3 wli3 May 24, 2021

Choose a reason for hiding this comment

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

AOT builds are slow, so in case the test is failing (IOW, it is able to build)

Then it should not be in the installer test. Installer end to end tests are for "if I have all the parts together" with the right version. dotnet/installer does not have parallel test support. And there are a lot of legs. It has less tolerant for flaky tests

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for testing whether all the parts for the workload, with the right versions work together or not. The tests shouldn't be flaky.

I'll change this to native relinking, which will be much quicker. And we can discuss AOT after that.

@radical
Copy link
Member Author

radical commented May 25, 2021

The python fix in emsdk required for building on linux, is not available here yet:

  1. runtime correctly has the bump to include that
  2. but sdk hasn't taken the bump for runtime yet ([main] Update dependencies from dotnet/sdk #10763),
  3. which means the installer doesn't have that either

I'll add a workaround here for now.

@radical radical force-pushed the wasm-workloads-aot branch 2 times, most recently from bcb9188 to 6079087 Compare May 29, 2021 00:50
@radical
Copy link
Member Author

radical commented May 29, 2021

Update:

  • tests still broken on osx - missing emsdk/python fix
  • linux - workload install throws NRE, that hasn't made it here yet

@radical
Copy link
Member Author

radical commented Jun 23, 2021

Current state:

  • The missing workload tests are failing because the error string changed
  • One of failing on windows because the path to mono-aot-cross.exe is too long (should install packs outside artifacts)
  • Invariant tests seem to be failing with
      System.UnauthorizedAccessException : Access to the path 'dotnet.exe' is denied.
      Stack Trace:
           at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel) in System.Private.CoreLib.dll:token 0x6005c81+0x163
           at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) in System.Private.CoreLib.dll:token 0x6005c7e+0x36
        /_/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/DirectoryInfoExtensions.cs(33,0): at Microsoft.DotNet.TestFramework.DirectoryInfoExtensions.EnsureExistsAndEmpty(DirectoryInfo subject)
        /_/test/Microsoft.DotNet.Tools.Tests.Utilities/TestAssets.cs(75,0): at Microsoft.DotNet.TestFramework.TestAssets.CreateTestDirectory(String testProjectName, String callingMethod, String identifier)
        /_/test/EndToEnd/WorkloadTests.cs(55,0): at EndToEnd.Tests.WorkloadTests.TestBlazorWasmWithWithWorkload(String extraBuildArgs, String callerName)
        /_/test/EndToEnd/WorkloadTests.cs(51,0): at EndToEnd.Tests.WorkloadTests.ItCanPublishBlazorWasmWithWorkloads_Invariant(String args)

Updated the PR, to fix the first one, and see how it does with main HEAD.

@radical
Copy link
Member Author

radical commented Jun 23, 2021

Current state:

  • Windows x64:
D:\workspace\_work\1\s\artifacts\bin\EndToEnd.Tests\Release\net6.0\Tests\EndToEnd.Tests\ItCanPublishBlazorWasmWithWorkloads_WithAOT\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0-preview.7.21321.15\Sdk\WasmApp.Native.targets(342,5):
  error : Could not find AOT cross compiler at $(_MonoAotCrossCompilerPath)=
  • Windows x86, installing workloads fails with Workload with id microsoft-net-sdk-blazorwebassembly-aot is not supported on this platform., which makes sense
  • But if you try to build the workload installed:
D:\workspace\_work\1\s\artifacts\bin\EndToEnd.Tests\Debug\net6.0\Tests\EndToEnd.Tests\ItCannotPublishBlazorWasm_AOTWithoutWorkloadInstalled\dotnet\sdk-manifests\6.0.100\microsoft.net.workload.mono.toolchain\WorkloadManifest.targets(50,37):
  error MSB4236: The SDK 'Microsoft.NET.Runtime.Emscripten.Python' specified could not be found.
  
[D:\workspace\_work\1\s\artifacts\bin\EndToEnd.Tests\Debug\net6.0\Tests\EndToEnd.Tests\ItCannotPublishBlazorWasm_AOTWithoutWorkloadInstalled\project\project.csproj]

@radical
Copy link
Member Author

radical commented Jun 23, 2021

@radical
Copy link
Member Author

radical commented Jun 24, 2021

@wli3 what would be the best way to skip tests on win/x86? Add support in one of the attributes, or can we use Microsoft.DotNet.XUnitExtensions? It had conflicts with existing type names when I tried to include it.

@radical
Copy link
Member Author

radical commented Jun 29, 2021

@wli3 I wanted to check again if the E2E AOT tests here be acceptable? If not in this repo, then where should this be tested? We need to test the SDK, and the workload packs that are generated.

@radical
Copy link
Member Author

radical commented Jul 8, 2021

Current state: Tests failing on linux because python is too old (<3.6).
Windows x86: workloads are not supported on win-x86, but not sure how to detect that, because RuntimeInformation.*Architecture return x64.

@radical
Copy link
Member Author

radical commented Jul 19, 2021

Closing this, as the plan is to test these in a different repo.

@radical radical closed this Jul 19, 2021
@radical radical deleted the wasm-workloads-aot branch July 19, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants