-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
All WasmBuildTests
use dotnet new
, unification
#109069
Open
ilonatommy
wants to merge
56
commits into
dotnet:main
Choose a base branch
from
ilonatommy:refactor-test-main-based-wbt
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.
Open
+3,718
−4,211
Conversation
This file contains 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
ilonatommy
added
arch-wasm
WebAssembly architecture
test-enhancement
Improvements of test source code
area-Build-mono
labels
Oct 21, 2024
…tOfAppBundleTests`, `WasmNativeDefaultsTests`, `WasmBuildAppTest`: done
kasperk81
reviewed
Nov 1, 2024
… BlazorBasicTestApp.
ilonatommy
requested review from
maraf,
lewing and
pavelsavara
as code owners
November 13, 2024 07:09
To be investigated - either refactoring was incorrect or using the standardized app revealed problems:
I would be happy to share this responsibility with volunteers. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
arch-wasm
WebAssembly architecture
area-Build-mono
test-enhancement
Improvements of test source code
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.
Main refactoring changes:
Creation of app
old - Create the information about the requested project (
BuildArgs
) and using an Action that was passed toBuildProject
, update the project that was hardcoded and used "data/test-main-7.0.js" or "test-main.js"new:
WasmBasicTestApp
orBlazorBasicTestApp
by usingCopyTestAsset
method. It is more reliable thantest-main.js
and faster than usingdotnet new
inside of the test.dotnet new {templateName}
command triggered byCreateWasmTemplateProject
and return object that contains information about the created project. All the editions to the template are explicitly done in the test by replacement methods, either default replacementUpdateBrowserMainJs()
/UpdateBrowserProgramFile()
or custom replacements:UpdateFile()
. Big snippets of code were moved totestassets
to shorten test files. We eitherFile.Copy()
them orReplaceFile()
with them.Building the app:
old - merged with application creation step. Used
BuildProjectOptions
orBlazorBuildOptions
.new - doing only build or publish, depending on the passed
IsPublish
argument. Uses unifiedBuildProjectOptions
for browser app and blazor app.GetExpectedFileType
is unified for all the tests - we avoid the need to check the condition for FromRuntimePack/AOT/Relinked dotnet in each test.Running the app:
old - browser app using
RunAndTestWasmApp
that bases on starting aSystem.Diagnostics.Process
inRunProcessAsync
, different way of handling messages, passing arguments etc. Blazor app using Playwright inBrowserRunner
.new - both apps use Playwright (see:
BrowserRunner
) and the running logic is mostly common. They use eitherRunForBuildWithDotnetRun
orRunForPublishWithWebServer
in wasm and blazor apps.Other bigger changes:
RunHost
that supports testing with V8 on CI. We can remove it and replace withRunHost
(DotnetRun
/WebServer
), used till this point only by Blazor tests.AssertOptions
,BuildOptions
, moving records/enums to separate classes inCommon
dir etc.BlazorWasmProjectProvider
- when we have only bowser-sdk-based tests, we don't need multiple providers. The base provider will be removed as well.TestMainJsProjectProvider
- same as above, it was for wasm console tests.TestMainJsTestBase
- removal + edition of all the tests that were using it (16 files).test-main.js
file works correctly:ConfigSrcTests.cs
.native-lib.o
TestAssetsPath