Repository navigation
[Experiment] Add browser WebAssembly launcher package #11305
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
Draft
Amaury Levé (Evangelink)
wants to merge
56
commits into
main
Choose a base branch
from
dev/amauryleve/mtp-browser-extension
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 46 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
3a9eae4
Add browser-wasm dotnet test launcher package
Evangelink 066ab8d
Secure browser launcher transport
Evangelink 086b063
Harden browser launcher packaging and cleanup
Evangelink 083be6d
Support framework-owned browser host pages
Evangelink ab878a3
Wrap computed browser hosts and version page API
Evangelink 651b5c3
Harden browser host and launch-info contracts
Evangelink 50932dc
Report fatal browser page integration errors
Evangelink 760ee9e
Fix browser launcher wrapping edge cases
Evangelink 89beb27
Gate browser launcher preview contract
Evangelink fc15c64
Isolate browser test invocations and cancellation
Evangelink 6d81426
Make pure managed browser apps canonical
Evangelink 62f9561
Simplify browser launcher experiment
Evangelink d0eefc0
Fix browser host static asset ownership
Evangelink e6d8e4e
Remove redundant browser fixture property
Evangelink 220f675
Address browser package review feedback
Evangelink d3d54c3
Harden minimal browser launcher boundaries
Evangelink 8fe7d67
Merge remote-tracking branch 'origin/main' into dev/amauryleve/mtp-br…
Evangelink cf60055
Stabilize browser launcher package validation
Evangelink a4d5814
Stabilize browser package CI assertions
Evangelink 0a1f96f
Disable ANSI in browser acceptance assets
Evangelink a552074
Normalize browser acceptance terminal output
Evangelink ad45692
Ignore telemetry banners in MSBuild property checks
Evangelink 93513d7
Productize browser dotnet test integration
Evangelink e541426
Require immutable inputs for browser acceptance
Evangelink ae2808b
Run desktop browser checks with aligned inputs
Evangelink febca12
Restore browser launcher target activation
Evangelink d1592cd
Validate aligned browser product lifecycle
Evangelink b6c7cac
Fail browser runs when artifact export fails
Evangelink b41d763
Document browser package release gates
Evangelink ffffd0d
Require composed browser acceptance inputs
Evangelink 4a6036b
Run composed browser validation in CI
Evangelink 9fad971
Expand browser validation matrix in aggregate
Evangelink 344ab39
Propagate build driver failures
Evangelink da3f8d6
Use short browser SDK checkout in CI
Evangelink edfee2d
Select source-matched SDK in browser tests
Evangelink eed7135
Pin browser runner with SDK identity propagation
Evangelink a70d238
Verify restored browser package identities
Evangelink e92dc79
Use minimal Windows SDK checkout path
Evangelink 0b38356
Enable long paths for browser SDK checkout
Evangelink ccccc8b
Use short isolated browser package cache
Evangelink ad741a2
Update browser testing SDK runner pin
Evangelink beda164
Add browser testing package filter
Evangelink 102082f
Expose MSBuild threading switch
Evangelink 7094ae3
Update browser runner for package filter
Evangelink b3c543a
Use VS2026 browser Windows agent
Evangelink bbbbfd2
Include analyzer package build dependency
Evangelink 303a5d8
Resolve acceptance package versions lazily
Evangelink 580258b
Reclaim SDK intermediates in browser CI
Evangelink c81b63a
Use capacity-backed Linux browser CI
Evangelink 4a728fc
Address browser package review feedback
Evangelink 3f63c69
Document experimental browser protocol capabilities
Evangelink c22e5fd
Merge main and align browser protocol allocations
Evangelink 5a29bc7
Expect protocol 1.5 in packed coverage checks
Evangelink dd63a33
Fix browser package localization and launcher reliability
Evangelink 11b0d39
Normalize browser satellite package paths across platforms
Evangelink 63d157f
Align browser acceptance with the validated SDK and verbose CLI output
Evangelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "solution": { | ||
| "path": "TestFx.slnx", | ||
| "projects": [ | ||
| "src\\Adapter\\MSTest.TestAdapter\\MSTest.TestAdapter.csproj", | ||
| "src\\Analyzers\\MSTest.Analyzers.Package\\MSTest.Analyzers.Package.csproj", | ||
| "src\\Analyzers\\MSTest.GlobalConfigsGenerator\\MSTest.GlobalConfigsGenerator.csproj", | ||
| "src\\Platform\\Microsoft.Testing.Extensions.Telemetry\\Microsoft.Testing.Extensions.Telemetry.csproj", | ||
| "src\\Platform\\Microsoft.Testing.Extensions.TrxReport.Abstractions\\Microsoft.Testing.Extensions.TrxReport.Abstractions.csproj", | ||
| "src\\Platform\\Microsoft.Testing.Platform.Browser\\Microsoft.Testing.Platform.Browser.csproj", | ||
| "src\\Platform\\Microsoft.Testing.Platform.MSBuild\\Microsoft.Testing.Platform.MSBuild.csproj", | ||
| "src\\Platform\\Microsoft.Testing.Platform\\Microsoft.Testing.Platform.csproj", | ||
| "src\\TestFramework\\TestFramework.Extensions\\TestFramework.Extensions.csproj" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| [ | ||
| "BrowserPackage_DotnetTestRunsAndListsTestsThroughSdkHttpGateway", | ||
| "BrowserPackage_DefinesDedicatedBrowserRunArguments", | ||
| "BrowserPackage_SdkCancellationStopsManagedBrowserRun", | ||
| "BrowserPackage_ArtifactQuotaFailureFailsRun", | ||
| "BrowserPackage_HostAssetsAreBuildOnlyConsumerAssets", | ||
| "BrowserPackage_DesktopTestApplicationIsUnaffected", | ||
| "BrowserPackage_ContainsPrivateCrossPlatformPlaywrightRuntime", | ||
| "BrowserPackage_PackNoBuildPreservesRuntimePayload", | ||
| "BrowserPackage_PackWithoutBundledNodePreservesPrivateDriverAndLicenses", | ||
| "BrowserPackage_InvalidExplicitBrowserPathFails", | ||
| "BrowserPackage_EvaluatedPropertyIgnoresTelemetryBanner" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "repository": "dotnet/sdk", | ||
| "commit": "df5a595b6fa32f65385bc40c8bf9506eed069f02" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| steps: | ||
| - checkout: self | ||
| fetchDepth: 1 | ||
| clean: true | ||
| persistCredentials: false | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: Build and verify the composed browser product | ||
| inputs: | ||
| pwsh: true | ||
| targetType: inline | ||
| script: | | ||
| $ErrorActionPreference = 'Stop' | ||
| $pin = Get-Content -LiteralPath '$(Build.SourcesDirectory)/eng/browser-testing/sdk.json' -Raw | ConvertFrom-Json | ||
| if ($pin.repository -ne 'dotnet/sdk' -or $pin.commit -notmatch '^[0-9a-f]{40}$') { | ||
| throw 'The browser validation SDK counterpart must be pinned to a full dotnet/sdk SHA.' | ||
| } | ||
|
|
||
| $browser = '$(browserExecutable)' | ||
| if (-not (Test-Path -LiteralPath $browser -PathType Leaf)) { | ||
| throw "The required Chromium-family browser is not installed at '$browser'." | ||
| } | ||
|
|
||
| New-Item -ItemType Directory -Path '$(Build.SourcesDirectory)/artifacts/log' -Force | Out-Null | ||
| $sdkRoot = if ($IsWindows) { | ||
| $driveRoot = [IO.Path]::GetPathRoot('$(Build.SourcesDirectory)') | ||
| Join-Path $driveRoot 'bsi' | ||
| } else { | ||
| "/tmp/bsi-$(Build.BuildId)-$(System.JobAttempt)" | ||
| } | ||
| if (Test-Path -LiteralPath $sdkRoot) { | ||
| throw "The clean SDK checkout path already exists: '$sdkRoot'." | ||
| } | ||
|
|
||
| git init --quiet $sdkRoot | ||
| if ($LASTEXITCODE -ne 0) { throw 'Unable to initialize the SDK checkout.' } | ||
| git -C $sdkRoot config core.longpaths true | ||
| if ($LASTEXITCODE -ne 0) { throw 'Unable to enable long paths for the disposable SDK checkout.' } | ||
| git -C $sdkRoot remote add origin "https://github.com/$($pin.repository).git" | ||
| if ($LASTEXITCODE -ne 0) { throw 'Unable to configure the SDK checkout.' } | ||
| git -C $sdkRoot fetch --depth 1 origin $pin.commit | ||
| if ($LASTEXITCODE -ne 0) { throw 'Unable to fetch the pinned SDK commit.' } | ||
| git -C $sdkRoot checkout --quiet --detach FETCH_HEAD | ||
| if ($LASTEXITCODE -ne 0) { throw 'Unable to check out the pinned SDK commit.' } | ||
| $actualCommit = (git -C $sdkRoot rev-parse HEAD).Trim() | ||
| if ($LASTEXITCODE -ne 0 -or $actualCommit -ne $pin.commit) { | ||
| throw "The SDK checkout '$actualCommit' does not match the pin '$($pin.commit)'." | ||
| } | ||
|
|
||
| & (Join-Path $sdkRoot 'eng/browser-testing/TestResultValidation.ps1') | ||
| if ($LASTEXITCODE -ne 0) { throw 'The SDK browser-result validator self-tests failed.' } | ||
| & (Join-Path $sdkRoot 'eng/browser-testing/RunBrowserTests.ps1') ` | ||
| -SdkRoot $sdkRoot ` | ||
| -TestFxRoot '$(Build.SourcesDirectory)' ` | ||
| -BrowserExecutable $browser ` | ||
| -Configuration Release ` | ||
| -ResultsDirectory '$(BrowserResultsDirectory)' | ||
| if ($LASTEXITCODE -ne 0) { throw 'The composed browser validation failed.' } | ||
|
|
||
| - task: PublishTestResults@2 | ||
| displayName: Publish mandatory browser acceptance results | ||
| condition: always() | ||
| inputs: | ||
| testResultsFormat: VSTest | ||
| testResultsFiles: '$(BrowserResultsDirectory)/test-results/browser.trx' | ||
| testRunTitle: 'Browser WebAssembly ($(image))' | ||
| failTaskOnFailedTests: true | ||
| failTaskOnMissingResultsFile: true | ||
|
|
||
| - pwsh: | | ||
| $hasEvidence = Test-Path -LiteralPath '$(BrowserResultsDirectory)' -PathType Container | ||
| Write-Host "Browser evidence under '$(BrowserResultsDirectory)': $hasEvidence" | ||
| Write-Host "##vso[task.setvariable variable=HasBrowserEvidence]$($hasEvidence.ToString().ToLowerInvariant())" | ||
| displayName: Check for composed browser evidence | ||
| condition: always() | ||
|
|
||
| - task: CopyFiles@2 | ||
| displayName: Collect composed browser diagnostics | ||
| condition: and(always(), eq(variables.HasBrowserEvidence, 'true')) | ||
| inputs: | ||
| SourceFolder: '$(BrowserResultsDirectory)' | ||
| Contents: | | ||
| **/*.log | ||
| **/*.json | ||
| **/*.trx | ||
| **/*.binlog | ||
| TargetFolder: '$(Build.ArtifactStagingDirectory)/browser-ci' | ||
|
|
||
| - task: PublishPipelineArtifact@1 | ||
| displayName: Publish composed browser diagnostics | ||
| condition: and(always(), eq(variables.HasBrowserEvidence, 'true')) | ||
| inputs: | ||
| targetPath: '$(Build.ArtifactStagingDirectory)/browser-ci' | ||
| artifact: 'Browser_$(image)_Attempt$(System.JobAttempt)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/Platform/Microsoft.Testing.Platform.Browser/BoundedResourceCleanup.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| namespace Microsoft.Testing.Platform.Browser; | ||
|
|
||
| internal static class BoundedResourceCleanup | ||
| { | ||
| public static async Task<T?> ObserveCreationAsync<T>( | ||
| Task<T> creationTask, | ||
| TimeSpan timeout, | ||
| Action<T> dispose, | ||
| Action<string> report) | ||
| where T : class | ||
| { | ||
| try | ||
| { | ||
| return await creationTask.WaitAsync(timeout).ConfigureAwait(false); | ||
| } | ||
| catch (TimeoutException) | ||
| { | ||
| report("Resource creation did not finish during bounded cleanup; disposal will continue in the background."); | ||
| _ = DisposeWhenCreatedAsync(creationTask, timeout, dispose, report); | ||
| return null; | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| report($"Resource creation failed during cleanup: {ex.Message}"); | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| public static async Task DisposeAsync( | ||
| Action dispose, | ||
| TimeSpan timeout, | ||
| Action<string> report) | ||
| { | ||
| try | ||
| { | ||
| await Task.Run(dispose).WaitAsync(timeout).ConfigureAwait(false); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| report($"Resource disposal did not complete cleanly: {ex.Message}"); | ||
| } | ||
| } | ||
|
|
||
| private static async Task DisposeWhenCreatedAsync<T>( | ||
| Task<T> creationTask, | ||
| TimeSpan timeout, | ||
| Action<T> dispose, | ||
| Action<string> report) | ||
| { | ||
| try | ||
| { | ||
| T resource = await creationTask.ConfigureAwait(false); | ||
| await DisposeAsync(() => dispose(resource), timeout, report).ConfigureAwait(false); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| report($"Late resource creation could not be cleaned up: {ex.Message}"); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.