-
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
All WasmBuildTests
use static project from assets or dotnet new
, unification of browser tests
#109069
All WasmBuildTests
use static project from assets or dotnet new
, unification of browser tests
#109069
Conversation
…tOfAppBundleTests`, `WasmNativeDefaultsTests`, `WasmBuildAppTest`: done
…better represented by `NameValueCollection` than `Dictionary`
…` + use statistics that are fingerprinting insensitive.
New recap of the current state:
I disabled it in #110482. It's an issue that surfaced after refactoring.
|
Runtime config is not passed to "runtime" (in the browser) for Wasm SDK based apps. We have a tracking issue to pass at least AppContext switch through boot config #97449 |
…d before the change in the test. Use Cryptography lib instead.
…BT class, divide it.
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.
Good job!
src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/AppSettingsTests.cs
Outdated
Show resolved
Hide resolved
…unification of browser tests (dotnet#109069) * Fix build errors in WASI - refactor of WASI in a future PR. * Fix binlog location. * Update README. * Feedback: non-nullable _projectDir. * Fix `SatelliteAssembliesTests` and other test that require 3 states of `WasmBuildNative` * `RebuildTests` fix after introducing figerprinting. * Fix no-worklod tests: 1) do not double-assert `AssertRuntimePackPath` in blazor 2) `AssertRuntimePackPath` is correct only when workload is there 3) NativeBuild should allow undefined in blazor tests as well. * Fix `NativeBuildTests` - AppBundle was not asserted here originally. * `WasmGenerateAppBundle=false` when workloads used (set in workload manifest). The check is incorrect in the current process of testing. * Fix `MainWithArgsTests`. Url query can have arg key duplicates -> is better represented by `NameValueCollection` than `Dictionary` * AppBundle was never asserted for size in `OptimizationFlagChangeTests` + use statistics that are fingerprinting insensitive. * Reading from config is a known issue. * Fix `ReferenceNewAssemblyRebuildTest`: Json lib was already referenced before the change in the test. Use Cryptography lib instead. * Keep blazor workload tests together. * Fix: `PInvokeTableGeneratorTests` on Windows. * Move all no-workload blazor tests to one class. * Use more meaningful name for `MiscTests3`. * `PInvokeTableGeneratorTests` takes 2-3 times more time than average WBT class, divide it. * Block the timeouting test with exisiting issue. * Try avoiding port collisions in blazor tests run on kestrel. * Removal of files and comments that were supposed to be deleted after approval.
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 if we use
BuildProject
orPublishProject
(BlazorBuild
,BlazorPublish
).GetExpectedFileType
is recognized automatically based on the info passed to build/publish options.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
DefaultTemplate_WithoutWorkload
fromBuildPublishTests
toWorkloadRequiredTests
.