-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Stop testing with V8 and wasmconsole
#108711
Conversation
…ning v8 scenario.
…itance, clean the code.
Tagging subscribers to 'arch-wasm': @lewing |
BuildTemplateProject(buildArgs, id: id, new BuildProjectOptions( | ||
AssertAppBundle: false, | ||
CreateProject: false, | ||
HasV8Script: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V8Script could be dropped too. I expect it would many more places than just WBT. Could be in next PR
@@ -28,4 +29,14 @@ public void AssertBundle(BlazorBuildOptions options) | |||
AssertIcuAssets: true, | |||
AssertSymbolsFile: false // FIXME: not supported yet | |||
)); | |||
|
|||
public override string FindBinFrameworkDir(string config, bool forPublish, string framework, string? projectDir = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to override it here? Blazor and Wasm SDK should behave the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, originally I didn't notice they are the same, it can be left in WasmSdkBasedProjectProvider
only.
Note for the future: once we will align BlazorBuildOptions
and AssertWasmSdkBundleOptions
then maybe we will even use WASM SDK provider in Blazor and drop BlazorWasmProjectProvider
.
|
||
public class DebugLevelTests : AppTestBase | ||
{ | ||
public DebugLevelTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge this one with Wasm.Build.Tests.DebugLevelTests
and use "WasmBasicTestApp" for all of the tests.
- Move it outside of Blazor namespace since it's not blazor specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not done because it would require more refactoring. In the feedback commit I moved them to one file and made them use WasBasicTestApp
but it broke the base class, now it's DebugLevelTests : AppTestBase
. Will be cleaned up better in a follow-up
Publish: true, | ||
TargetFramework: BuildTestBase.DefaultTargetFramework, | ||
UseCache: false, | ||
IsBrowserProject: isBrowser, | ||
IsBrowserProject: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove IsBrowserProject
or similar if we have any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet. We have a significant bundle assert check that based on its value uses either the wasm sdk-like way assert or deprecated but still used by tests (to be removed in a follow up) mainJs-like assert. This would lead to too many other changes. Later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since everything is now Wasm SDK, I think we can remove this base class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it can be removed in the follow up that will be getting rid of TestMainJsProjectProvider
that is still based on ProjectProviderBase
and used in ~16 test files.
Follow up for #108582 (comment).
wasmconsole
inWasmBuildTests
. Some tests were using console scenario but did not mean to target specifically console, so they had to stay but be changed to usebrowserwasm
. This revealed a bunch of inconsistencies that required refactoring. I will try to list the biggest refactoring changes in the following points.WasmTemplateTestBase
andWasmTemplateTestsBase
that in fact could be consolidated in one class.NativeBuildTests <- WasmTemplateTestBase <- BlazorWasmTestBase <- WasmTemplateTestsBase <- BuildTestBase
This was refactored to have blazor and browser apps in 2 logical "flows", e.g.:
WorkloadRequiredTests <- BlazorWasmTestBase <- WasmTemplateTestsBase <- BuildTestBase
NativeBuildTests <- WasmTemplateTestsBase <- BuildTestBase
RunCommand
andToolCommand
directly in the tests. Theye were exchanged for wrappers. For build/publish action we should useBuildTemplateProject
and for running the browser app,RunBrowser
. It is supposed to get merged with Blazor-based runners in a follow up PR, it will take too many changes to do it here.!(buildArgs.AOT || buildArgs.Config == "Release")
a lot, so it got closed inIsDotnetWasmFromRuntimePack
.BuildProjectOptions
, so we will have a "base" form of options (_basePublishProjectOptions
,_baseBuildProjectOptions
) that we can extend in the specific test but most frequently we use them in the default form.The issues that were discovered when refactoring will be temporarily marked as "Issue" in the comment, then if not fixed, they will be logged as separate issues in the repo.
Follow-up PRs that will be published after this one is done:
[BuildAndRun(
that creates a console app (withMicrosoft.NET.Sdk
), we should use templating mechanism. We still have ~40 tests that do not use templates.AppTestBase
,TestMainJsTestBase
,TestMainJsProjectProvider
and consolidate running methods fromAppTestBase
andWasmTemplateTestsBase
, so tests derive fromWasmTemplateTestsBase
if they are browser apps and fromBlazorWasmTestBase
if they are blazor apps, nothing more. Clean up option records,BuildProjectOptions
,BlazorRunOptions
,BlazorBuildOptions
etc.