Skip to content

[wasm] WBT fixes, and rationalization to allow improved testing#89360

Merged
radical merged 11 commits intodotnet:mainfrom
radical:wbt-new-pr
Jul 25, 2023
Merged

[wasm] WBT fixes, and rationalization to allow improved testing#89360
radical merged 11 commits intodotnet:mainfrom
radical:wbt-new-pr

Conversation

@radical
Copy link
Member

@radical radical commented Jul 23, 2023

Merge behaviors for the various project types:

  • Move parsing bootjson, checking icu assets, symbols to ProviderBase, so it can
    be used by all the project types. These come from WasmAppBuilder which
    is shared by all the projects.

  • Instead of multiple separate ways to build the project, use one
    BuildTestBase.BuildWithoutAssert method that uses DotNetCommand to
    build. And all the project types can use this.

    • This allows having any build customizations or fixes to be in once
      place, and the outputs to be consistent.
  • Instead of having UseWebcil in various option types, use it directly
    as needed, because this setting is not changed per test, rather it
    is fixed per run.

  • Rationalize figuring out bin framework directories

Known limitations:

  • Wasm template tests use a TestMainJs provider to assert the bundle
    because the templates are not yet based on wasm sdk.
  • Blazor has a bug due to which all the icu assets get deployed
    irrespective of settings, so asserting that is disabled.
  • Also, blazor does not yet support symbols file.

radical added 6 commits July 23, 2023 00:41
- FileStat
- BuildPaths
- BlazorBuildOptions
- GlobalizationMode
- Move parsing bootjson, checking icu assets, symbols to ProviderBase, so it can
  be used by all the project types. These come from WasmAppBuilder which
  is shared by all the projects.

- Instead of multiple separate ways to build the project, use one
  `BuildTestBase.BuildWithoutAssert` method that uses `DotNetCommand` to
  build. And all the project types can use this.
  - This allows having any build customizations or fixes to be in once
    place, and the outputs to be consistent.

- Instead of having `UseWebcil` in various option types, use it directly
  as needed, because this setting is *not* changed per test, rather it
  is fixed per run.

- Rationalize figuring out bin framework directories

Known limitations:
- Wasm template tests use a TestMainJs provider to assert the bundle
  because the templates are not yet based on wasm sdk.
- Blazor has a bug due to which all the icu assets get deployed
  irrespective of settings, so asserting that is disabled.
- Also, blazor does not yet support symbols file.
@radical radical added the arch-wasm WebAssembly architecture label Jul 23, 2023
@ghost ghost assigned radical Jul 23, 2023
@ghost ghost added the area-Build-mono label Jul 23, 2023
@ghost
Copy link

ghost commented Jul 23, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Move DotNetFileName.cs, and TestUtils.cs to Common
  • Move some types from BuildTestBase.cs to separate files
  • Move AssertTestMainJsAppBundleOptions.cs to Common
  • Instead of globalizationMode=null use GlobalizationMode.Default
  • Merge behaviors for the various project types
  • Update tests to track api changes
Author: radical
Assignees: -
Labels:

arch-wasm

Milestone: -

@radical radical changed the title wbt new pr [wasm] WBT fixes, and rationalization to allow improved testing Jul 23, 2023
@radical
Copy link
Member Author

radical commented Jul 23, 2023

I would suggest reading it commit-wise.

@radical
Copy link
Member Author

radical commented Jul 23, 2023

TODO: In a follow up PR, I will merge methods doing the dotnet native file stuff, and maybe with the icu thing too.

@radical radical requested review from ilonatommy and maraf July 23, 2023 01:21
Copy link
Member

@ilonatommy ilonatommy left a comment

Choose a reason for hiding this comment

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

Good job

#nullable enable

namespace Wasm.Build.Tests;
public enum GlobalizationMode
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these two enums have same values

declare const enum GlobalizationMode {
?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed. They are the "same", but naming being the same should be helpful too. I'll change in a follow up if there aren't more changes to be done here.

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@radical radical merged commit 12396a3 into dotnet:main Jul 25, 2023
@radical radical deleted the wbt-new-pr branch July 25, 2023 15:32
@ghost ghost locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Build-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants