Skip to content
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

Add Blazor SWA Baseline Mismatched Assets Logging #27542

Merged
merged 11 commits into from
Nov 3, 2022

Conversation

TanayParikh
Copy link
Contributor

@TanayParikh TanayParikh added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label Aug 29, 2022
@TanayParikh TanayParikh self-assigned this Aug 29, 2022
Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

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

Seems fine, but would it be more likely to avoid rot if it was pasted into AspNetSdkBaselineTest.cs and instructions directed there instead?

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

I think we need to make sure we are getting the desired outcome before moving forward with the changes.

We should also just put a link to the wiki with the appropriate instructions (there is a script to deal with it now in one go)

TanayParikh added a commit that referenced this pull request Oct 5, 2022
@TanayParikh TanayParikh requested a review from a team as a code owner November 1, 2022 23:28
@TanayParikh
Copy link
Contributor Author

Also added some more instructions to make this more actionable: e585f49

@TanayParikh
Copy link
Contributor Author

TanayParikh commented Nov 2, 2022

There isn't a great way to have super customized error message with fluent assertions, but after playing around with it a bit, I'm getting the following.

Same number of manifest assets, `AssetTraitValue` property differs on one asset:
    Expected differences to be empty because the generated manifest should match the expected baseline.

If the difference in baselines is expected, please re-generate the baselines.
Note, baseline generation must be done on a Windows device.
Start by ensuring you're dogfooding the SDK from the current branch (dotnet --version should be '*.0.0-dev').
    If you're not on the dogfood sdk, from the root of the repository run:
        1. dotnet clean
        2. .\restore.cmd
        3. .\build.cmd
        4. .\eng\dogfood.cmd

Then, using the dogfood SDK run the .\src\RazorSdk\update-test-baselines.ps1 script.

, but found {"
==================================================

For C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\PackageLibraryDirectDependency.bundle.scp.css:

Expected manifest AssetTraitValue of ProjectBundle but found {{Some fake trait value}}.

=================================================="}.
Same number of manifest assets, `AssetTraitValue` property differs on **all** assets:
Expected differences to be empty because the generated manifest should match the expected baseline.

If the difference in baselines is expected, please re-generate the baselines.
Note, baseline generation must be done on a Windows device.
Start by ensuring you're dogfooding the SDK from the current branch (dotnet --version should be '*.0.0-dev').
    If you're not on the dogfood sdk, from the root of the repository run:
        1. dotnet clean
        2. .\restore.cmd
        3. .\build.cmd
        4. .\eng\dogfood.cmd

Then, using the dogfood SDK run the .\src\RazorSdk\update-test-baselines.ps1 script.

, but found {"
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\AnotherClassLib\wwwroot\AnotherClassLib.lib.module.build.js:

Expected manifest AssetTraitValue of JSLibraryModule but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\AnotherClassLib\wwwroot\css\site.css:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\AnotherClassLib\wwwroot\js\project-direct-dep.js:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\AppWithPackageAndP2PReference\obj\Debug\net7.0\jsmodules\jsmodules.build.manifest.json:

Expected manifest AssetTraitValue of JSModuleManifest but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\AppWithPackageAndP2PReference\obj\Debug\net7.0\scopedcss\bundle\AppWithPackageAndP2PReference.styles.css:

Expected manifest AssetTraitValue of ApplicationBundle but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\ClassLibrary\obj\Debug\net7.0\scopedcss\projectbundle\ClassLibrary.bundle.scp.css:

Expected manifest AssetTraitValue of ProjectBundle but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\ClassLibrary\wwwroot\js\project-transitive-dep.js:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\tmp\Debug\PublishProjec---84E11935\ClassLibrary\wwwroot\js\project-transitive-dep.v4.js:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\css\site.css:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\js\pkg-direct-dep.js:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\PackageLibraryDirectDependency.bundle.scp.css:

Expected manifest AssetTraitValue of ProjectBundle but found {{Some fake trait value}}.

==================================================", "
==================================================

For C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarytransitivedependency\[[CustomPackageVersion]]\staticwebassets\js\pkg-transitive-dep.js:

Expected manifest AssetTraitValue of  but found {{Some fake trait value}}.

=================================================="}.
Different number of manifest assets:

(just did a skip 2)

    System.Exception : The following expected assets weren't found in the manifest:
	C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\css\site.css
	C:\Users\taparik\dev\sdk\artifacts\.nuget\packages\packagelibrarydirectdependency\[[CustomPackageVersion]]\staticwebassets\js\pkg-direct-dep.js

If the difference in baselines is expected, please re-generate the baselines.
Note, baseline generation must be done on a Windows device.
Start by ensuring you're dogfooding the SDK from the current branch (dotnet --version should be '*.0.0-dev').
    If you're not on the dogfood sdk, from the root of the repository run:
        1. dotnet clean
        2. .\restore.cmd
        3. .\build.cmd
        4. .\eng\dogfood.cmd

Then, using the dogfood SDK run the .\src\RazorSdk\update-test-baselines.ps1 script.

@TanayParikh TanayParikh merged commit bacc17c into main Nov 3, 2022
@TanayParikh TanayParikh deleted the taparik/addMismatchManifestLogging branch November 3, 2022 20:24
TanayParikh added a commit that referenced this pull request Nov 3, 2022
* Add Blazor AssetDifferencesDetails

* Update AspNetSdkBaselineTest.cs

For https://github.com/dotnet/sdk/issues/27346

* Spacing

* Create blazor-swa-baseline-generation.md

* PR Feedback

* Remove instructions add script reference

* Property level comparison

* Added instructions

* Update AspNetSdkBaselineTest.cs

* Update AspNetSdkBaselineTest.cs

(cherry picked from commit bacc17c)
TanayParikh added a commit that referenced this pull request Nov 3, 2022
* Add Blazor AssetDifferencesDetails

* Update AspNetSdkBaselineTest.cs

For https://github.com/dotnet/sdk/issues/27346

* Spacing

* Create blazor-swa-baseline-generation.md

* PR Feedback

* Remove instructions add script reference

* Property level comparison

* Added instructions

* Update AspNetSdkBaselineTest.cs

* Update AspNetSdkBaselineTest.cs

(cherry picked from commit bacc17c)
TanayParikh added a commit that referenced this pull request Nov 3, 2022
* Add Blazor AssetDifferencesDetails

* Update AspNetSdkBaselineTest.cs

For https://github.com/dotnet/sdk/issues/27346

* Spacing

* Create blazor-swa-baseline-generation.md

* PR Feedback

* Remove instructions add script reference

* Property level comparison

* Added instructions

* Update AspNetSdkBaselineTest.cs

* Update AspNetSdkBaselineTest.cs

(cherry picked from commit bacc17c)
TanayParikh added a commit that referenced this pull request Nov 10, 2022
…Logging (#28894)

* Add Blazor SWA Baseline Mismatched Assets Logging (#27542)

* Add Blazor AssetDifferencesDetails

* Update AspNetSdkBaselineTest.cs

For https://github.com/dotnet/sdk/issues/27346

* Spacing

* Create blazor-swa-baseline-generation.md

* PR Feedback

* Remove instructions add script reference

* Property level comparison

* Added instructions

* Update AspNetSdkBaselineTest.cs

* Update AspNetSdkBaselineTest.cs

(cherry picked from commit bacc17c)

* Create update-test-baselines.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Blazor WASM Baselines Tests to Indicate Unexpected Files
3 participants