Skip to content

Playwright: Run some real tests in Migration.E2E.Tests #32428

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

Merged
merged 46 commits into from
Aug 5, 2021
Merged

Playwright: Run some real tests in Migration.E2E.Tests #32428

merged 46 commits into from
Aug 5, 2021

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented May 5, 2021

Summary of changes

  • Includes both the testassets/BasicApp contents, in addition to the published wwwroot merged into the helix payload
  • Add two real e2e tests to make sure things work and prototype the changes
  • Changes to make dotnet test work now
  • Refactor playwright test base from BlazorTemplates + this into a BrowserTestBase in the shared BrowserTesting library
  • BrowserKind detected via first test method argument (defaults to Chrome otherwise), Chome/Firefox working, WebKit tbd

Issues:

  • Firefox fails on linux due to profile directory issues (launcher might create/delete profile folder on each launch)
  • ubuntu still skipped

Stability stats after moving to separate test project:
0 / 1 runs no build issues

Build issues seen sometimes:

.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets#L142
.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(142,5): error MSB3231: (NETCORE_ENGINEERING_TELEMETRY=Build) Unable to remove directory "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\". Could not find a part of the path '\\?\D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\ErrorBoundaryTest'.

##[error].dotnet\sdk\6.0.100-preview.5.21264.3\Microsoft.Common.CurrentVersion.targets(2202,5): error MSB3101: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not write state file "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache". The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache' because it is being used by another process.
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Microsoft.Common.CurrentVersion.targets(2202,5): error MSB3101: Could not write state file "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache". The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache' because it is being used by another process. [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
##[error].dotnet\sdk\6.0.100-preview.5.21264.3\Microsoft.Common.CurrentVersion.targets(2202,5): error MSB3101: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not write state file "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache". The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.csproj.AssemblyReference.cache' because it is being used by another process.
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018: The "GenerateBlazorWebAssemblyBootJson" task failed unexpectedly. [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018: System.IO.IOException: The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\blazor.boot.json' because it is being used by another process. [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ValidateFileHandle(SafeFileHandle fileHandle, String path, Boolean useAsyncIO) in System.Private.CoreLib.dll:token 0x6005b6c+0x25 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.CreateFileOpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b67+0x78 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.Strategies.WindowsFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005c26+0x61 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b64+0x2c [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600583e+0xa8 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at System.IO.File.Create(String path) in System.IO.FileSystem.dll:token 0x60000f0+0x0 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson.Execute() in Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll:token 0x6000062+0x0 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in Microsoft.Build.dll:token 0x60015da+0x3e [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) in Microsoft.Build.dll:token 0x600145a+0x809 [D:\workspace\_work\1\s\src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj]
##[error].dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(300,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "GenerateBlazorWebAssemblyBootJson" task failed unexpectedly.
System.IO.IOException: The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\blazor.boot.json' because it is being used by another process.
   at System.IO.Strategies.FileStreamHelpers.ValidateFileHandle(SafeFileHandle fileHandle, String path, Boolean useAsyncIO) in System.Private.CoreLib.dll:token 0x6005b6c+0x25
   at System.IO.Strategies.FileStreamHelpers.CreateFileOpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b67+0x78
   at System.IO.Strategies.WindowsFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005c26+0x61
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b64+0x2c
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600583e+0xa8
   at System.IO.File.Create(String path) in System.IO.FileSystem.dll:token 0x60000f0+0x0
   at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson.Execute() in Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll:token 0x6000062+0x0
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in Microsoft.Build.dll:token 0x60015da+0x3e
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) in Microsoft.Build.dll:token 0x600145a+0x809
  BasicTestApp -> D:\workspace\_work\1\s\artifacts\bin\BasicTestApp\Release\net6.0\BasicTestApp.dll

Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets

.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(142,5): error MSB3231: (NETCORE_ENGINEERING_TELEMETRY=Build) Unable to remove directory "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\". Access to the path '\\?\D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\AuthTest' is denied.

.dotnet\sdk\6.0.100-preview.5.21264.3\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(142,5): error MSB3231: (NETCORE_ENGINEERING_TELEMETRY=Build) Unable to remove directory "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\". Access to the path '\\?\D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\Razor\ServerReliability' is denied.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label May 5, 2021

protected async Task ClearAndType(string selector, string value)
{
await _page.EvalOnSelectorAsync(selector, "e => e.Value = ''");
Copy link
Member Author

Choose a reason for hiding this comment

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

todo: add extension static class and move helpers

_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(_tempDirectory);

//Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Copy link
Member Author

Choose a reason for hiding this comment

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

E2E tests try to navigate/avoid reloads, revisit later (optimization?)

@HaoK
Copy link
Member Author

HaoK commented May 12, 2021

Might need to add some explicit ordering to the build pipelines, there's contention for writing the basictestapp now

CSC(0,0): error CS2012: (NETCORE_ENGINEERING_TELEMETRY=Build) Cannot open 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.dll' for writing -- 'The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.dll' because it is being used by another process.'

@HaoK
Copy link
Member Author

HaoK commented May 14, 2021

@pranavkm @captainsafia have you guys ever seen this error from publishing before? I've seen it happen a few times before, and now its happened on back to back builds, I copied the trimming target from E2E tests but made it unconditional for helix to get the published BasicTestApp for the payload. Any ideas what could cause this?

  Microsoft.AspNetCore.Components.Migration.E2ETests -> D:\workspace\_work\1\s\artifacts\bin\Microsoft.AspNetCore.Components.Migration.E2ETests\Release\net6.0\Microsoft.AspNetCore.Components.Migration.E2ETests.dll
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Compressing Blazor WebAssembly publish artifacts. This may take a while...
##[error].dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(627,5): error MSB6006: (NETCORE_ENGINEERING_TELEMETRY=Build) "D:\workspace\_work\1\s\.dotnet" exited with code 1.
  Microsoft.AspNetCore.Components.WebAssembly.Server.Tests -> D:\workspace\_work\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests\Release\net6.0\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.dll
  Microsoft.AspNetCore.Components.WebAssembly.Server.Tests -> D:\workspace\_work\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests\Release\net6.0\publish\

Also got

.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "GenerateBlazorWebAssemblyBootJson" task failed unexpectedly.
System.IO.IOException: The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\blazor.publish.boot.json' because it is being used by another process.
   at System.IO.Strategies.FileStreamHelpers.ValidateFileHandle(SafeFileHandle fileHandle, String path, Boolean useAsyncIO) in System.Private.CoreLib.dll:token 0x6005b6a+0x25
   at System.IO.Strategies.FileStreamHelpers.CreateFileOpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b65+0x78
   at System.IO.Strategies.WindowsFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005c24+0x61
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b62+0x2c
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600583c+0xa8
   at System.IO.File.Create(String path) in System.IO.FileSystem.dll:token 0x60000f0+0x0
   at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson.Execute() in Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll:token 0x6000062+0x0
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in Microsoft.Build.dll:token 0x60015da+0x3e
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) in Microsoft.Build.dll:token 0x600145a+0x809

@HaoK HaoK requested a review from javiercn May 14, 2021 15:45
@HaoK
Copy link
Member Author

HaoK commented May 14, 2021

@javiercn do you want to start taking a look at this PR? Its got most of the initial shape done now minus some minor refactoring. We have all of the InputFiles test, and a few other tests migrated as some initial examples. Could probably move some more of the initialization boilerplate up somewhere, but I want to get your initial thoughts on things before I spend time cleaning up and polishing

@HaoK HaoK requested a review from a team May 20, 2021 15:59
@HaoK HaoK marked this pull request as ready for review May 20, 2021 15:59
@HaoK HaoK requested review from Pilchie and a team as code owners May 20, 2021 15:59
@HaoK
Copy link
Member Author

HaoK commented May 20, 2021

Still seeing build flakiness:

D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(627,5): error MSB6006: "D:\workspace\_work\1\s\.dotnet" exited with code 1. [D:\workspace\_work\1\s\src\Components\test\testassets\GlobalizationWasmApp\GlobalizationWasmApp.csproj]
##[error].dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(627,5): error MSB6006: (NETCORE_ENGINEERING_TELEMETRY=Build) "D:\workspace\_work\1\s\.dotnet" exited with code 1.

@HaoK
Copy link
Member Author

HaoK commented May 21, 2021

Another potential variant of build ordering error in GenerateBlazorWebAssemblyBootJson:

D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018: The "GenerateBlazorWebAssemblyBootJson" task failed unexpectedly. [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018: System.IO.IOException: The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\StandaloneApp\Release\net6.0\blazor.publish.boot.json' because it is being used by another process. [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ValidateFileHandle(SafeFileHandle fileHandle, String path, Boolean useAsyncIO) in System.Private.CoreLib.dll:token 0x6005b6a+0x25 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.CreateFileOpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b65+0x78 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.Strategies.WindowsFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005c24+0x61 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b62+0x2c [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600583c+0xa8 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at System.IO.File.Create(String path) in System.IO.FileSystem.dll:token 0x60000f0+0x0 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson.Execute() in Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll:token 0x6000062+0x0 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in Microsoft.Build.dll:token 0x60015da+0x3e [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
D:\workspace\_work\1\s\.dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) in Microsoft.Build.dll:token 0x600145a+0x809 [D:\workspace\_work\1\s\src\Components\WebAssembly\testassets\StandaloneApp\StandaloneApp.csproj]
##[error].dotnet\sdk\6.0.100-preview.5.21230.2\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(546,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "GenerateBlazorWebAssemblyBootJson" task failed unexpectedly.
System.IO.IOException: The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\StandaloneApp\Release\net6.0\blazor.publish.boot.json' because it is being used by another process.
   at System.IO.Strategies.FileStreamHelpers.ValidateFileHandle(SafeFileHandle fileHandle, String path, Boolean useAsyncIO) in System.Private.CoreLib.dll:token 0x6005b6a+0x25
   at System.IO.Strategies.FileStreamHelpers.CreateFileOpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b65+0x78
   at System.IO.Strategies.WindowsFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options) in System.Private.CoreLib.dll:token 0x6005c24+0x61
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x6005b62+0x2c
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600583c+0xa8
   at System.IO.File.Create(String path) in System.IO.FileSystem.dll:token 0x60000f0+0x0
   at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateBlazorWebAssemblyBootJson.Execute() in Microsoft.NET.Sdk.BlazorWebAssembly.

@HaoK
Copy link
Member Author

HaoK commented May 22, 2021

3rd variation of build contention

.dotnet\sdk\6.0.100-preview.5.21230.2\Microsoft.Common.CurrentVersion.targets(3161,5): error MSB3554: (NETCORE_ENGINEERING_TELEMETRY=Build) Cannot write to the output file "D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.Resources.resources". The process cannot access the file 'D:\workspace\_work\1\s\artifacts\obj\BasicTestApp\Release\net6.0\BasicTestApp.Resources.resources' because it is being used by another process.

}

//[Fact]
//public void CanBindTextbox_InitiallyPopulated()
Copy link
Member

Choose a reason for hiding this comment

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

Are you wanting to convert these tests before merging the PR or?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I just want a small set of tests to start with, there's 12 right now. I don't want to onboard too many tests before we are happy and settle on the overall pattern. Its already a bit of a hassle to have to update so many tests when changing some of test patterns.

I had some open questions still about whether it was safe or a good idea to reuse the browser navigation page (TestPage property), I had to do some slightly sketchy stuff to make this work with the BrowserKind attribute.

var browserKindArgument = context.MethodArguments.FirstOrDefault();

I also wanted to make sure we were happy with the existing MountTestComponent pattern before going too much farther.

protected async Task MountTestComponentAsync(IPage page)

This is the first time I've seen how these test were setup, but now is a good time to consider if there's any improvements to make here. I don't know have anything in mind in terms of changes or improvements, but I wanted to double check we are happy with this method of test selection

Copy link
Member Author

Choose a reason for hiding this comment

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

In terms of next steps, I think once we are mostly happy with the shape of things, I'll probably try turning on a single test in every file to play minesweeper and see what explodes and find where the gaps still are (in a future PR)

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Looks great so far!

return;
}

TestBrowser = await BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo);
Copy link
Member

Choose a reason for hiding this comment

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

Is this launching a new browser every time?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I still have to get to #31111 which will tackle figuring out the best way to share fixtures/browser instances. Seems like we could just have a static BrowserManager instead of a shared fixture too right?

HaoK added 16 commits August 4, 2021 11:21
Update .azure/pipelines/ci.yml

Co-authored-by: Safia Abdalla <[email protected]>

Update helix-matrix.yml

Update helix-matrix.yml

Break test to verify browser/platform coverage

Debug avail browsers

Update Build.props

Update ComponentTestBase.cs

Don't delete temp directory if not set

Update ComponentTestBase.cs

Update playwrightSettings.linux.json

Update playwrightSettings.ci.json

Update BinaryHttpClientTest.cs

Update BinaryHttpClientTest.cs

Update BinaryHttpClientTest.cs

Try turning off build in parallel

Create copy of basic test app -> mega test app

Update playwrightSettings.json

Fix publish path

Add new test project to slns, skip mariner

Revert chromium change on ci.linux

Reenable parallel builds

Turn off parallel again

Turn off test parallelization

Update src/Components/test/testassets/MegaTestApp/MegaTestApp.csproj

Co-authored-by: Safia Abdalla <[email protected]>

Delete mega test app

Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj

Update AspNetCore.sln

Update AspNetCore.sln

Update Build.props

Update Components.slnf

Update BrowserTestBase.cs

Update PlaywrightFixture.cs
@HaoK HaoK merged commit 7d7aba7 into main Aug 5, 2021
@HaoK HaoK deleted the haok/pw3 branch August 5, 2021 18:57
@ghost ghost added this to the 6.0-rc1 milestone Aug 5, 2021
@HaoK HaoK mentioned this pull request Aug 5, 2021
3 tasks
@captainsafia
Copy link
Member

Huzzah!

@HaoK
Copy link
Member Author

HaoK commented Aug 5, 2021

Huzzah!

I just binged Mythic Quest last week, so I can't help but think of Everlight when I hear that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants