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

All WasmBuildTests use dotnet new, unification #109069

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8c91ed8
`ConfigSrcTests`, `BuildPublishTests` ready.
ilonatommy Oct 21, 2024
a451e4e
Fix WASI build errors - WASI is not prepared for making `BrowserStruc…
ilonatommy Oct 21, 2024
afd4d5c
Non-invariatn globalization WBT: done.
ilonatommy Oct 21, 2024
f2bb8ab
Missing change to previous commit.
ilonatommy Oct 21, 2024
cd4f94d
`InvariantGlobalizationTests` done
ilonatommy Oct 21, 2024
531a197
Missing change to icu tests.
ilonatommy Oct 21, 2024
d762fb6
`InvariantTimezoneTests` done
ilonatommy Oct 21, 2024
84d1df2
Draft of `MainWithArgsTests` - does not work.
ilonatommy Oct 22, 2024
43fbb6e
Consolidate Blazor and Browser app run methods.
ilonatommy Oct 22, 2024
58d2e43
`NativeBuildTests`: done.
ilonatommy Oct 22, 2024
2f03ff1
HybridGlobalization should be disabled till removal.
ilonatommy Oct 22, 2024
31b3239
`NativeLibraryTests`: done.
ilonatommy Oct 22, 2024
1d94cf9
Blocked `SkiaSharp` test has to get refactored as well to remove buil…
ilonatommy Oct 23, 2024
1e7bf92
Fix build errors in WASI - refactor of WASI in a future PR.
ilonatommy Oct 23, 2024
970468a
Project lib extension depends on `UseWebcil` value.
ilonatommy Oct 23, 2024
8ea5538
`NoopNativeRebuildTest`: done.
ilonatommy Oct 23, 2024
df091e7
Assert test run exit code.
ilonatommy Oct 23, 2024
2500064
ToDo: `NativeRebuildTests` that still require work.
ilonatommy Oct 23, 2024
0f502df
Merge `AppTestBase` with `WasmTemplateTestBase`.
ilonatommy Oct 24, 2024
f7f0041
NativeRelink cannot be false when it's forced by other property values.
ilonatommy Oct 25, 2024
309bd9a
Fix minor mistakes in refactoring.
ilonatommy Oct 25, 2024
fe7b988
`WasmBuildAppBase`: done but reading from config fails.
ilonatommy Oct 25, 2024
bb96e7d
`WorkloadTests`, `WasmTemplateTestsBase`, `WasmSIMDTests`, `WasmRunOu…
ilonatommy Oct 25, 2024
902f6d0
Correct typo in assets path + shorten.
ilonatommy Nov 1, 2024
c1dbde6
Fix binlog location.
ilonatommy Nov 1, 2024
e05d2aa
Fix `WasmNativeDefaultsTests`
ilonatommy Nov 1, 2024
7cbec74
Merge remote-tracking branch 'origin/main' into refactor-test-main-ba…
ilonatommy Nov 1, 2024
15860cf
Block tests that should get fixed later.
ilonatommy Nov 4, 2024
a0974c7
Correct a typo.
ilonatommy Nov 4, 2024
1f74ee2
Avoid AOT long path issues in scenario-based tests on Windows.
ilonatommy Nov 4, 2024
5cf34db
Missing file in arg rename.
ilonatommy Nov 4, 2024
b3b82c1
Workaround for interpreter issues.
ilonatommy Nov 4, 2024
1a0ea6e
Improve workaround.
ilonatommy Nov 5, 2024
10dd1ab
Avoid timeouts on Windows.
ilonatommy Nov 6, 2024
c8ef33d
Missing change for the previous commit.
ilonatommy Nov 6, 2024
bc444bf
`PInvokeTableGeneratorTests`: done (with two issues).
ilonatommy Nov 8, 2024
ce03481
Merge remote-tracking branch 'origin/main' into refactor-test-main-ba…
ilonatommy Nov 8, 2024
9a1fcfb
Merge branch 'main' into refactor-test-main-based-wbt
ilonatommy Nov 8, 2024
e63800e
`NonWasmTemplateBuildTests`: done
ilonatommy Nov 8, 2024
0279b78
`SatelliteAssembliesTests`: done
ilonatommy Nov 11, 2024
79c6963
`RebuildTests`: done. `TestMainJsTestBase` is not used anymore.
ilonatommy Nov 11, 2024
42aae42
`WasmTemplateTests`: done.
ilonatommy Nov 11, 2024
2f1fd89
`NativeBuildTests`: done
ilonatommy Nov 11, 2024
58d3563
Started unifying blazor methods. `AppsettingsTests`: done.
ilonatommy Nov 11, 2024
a1ccf58
Added blazor equivalent of `WasmBasicTestApp`. `Blazor.BuildPublishTe…
ilonatommy Nov 11, 2024
902030f
Some tests should stay disabled.
ilonatommy Nov 11, 2024
a52e09b
`Blazor.CleanTests`: done
ilonatommy Nov 12, 2024
ee9c355
`Blazor.MiscTests`: done
ilonatommy Nov 12, 2024
4684136
`Blazor.MiscTests2`" done.
ilonatommy Nov 12, 2024
96b0cff
`MiscTests3`: done. Debug with aot is not supported. Added library to…
ilonatommy Nov 12, 2024
ab894fe
`NativeTests`: done
ilonatommy Nov 12, 2024
d8762cc
`NativeTests`: uncomment.
ilonatommy Nov 12, 2024
f40cf8a
`NoopNativeRebuildTest`: done
ilonatommy Nov 12, 2024
5505603
`SimpleRunTests`: done
ilonatommy Nov 12, 2024
0af3355
`Blazor.WorkloadRequiredTests`: done
ilonatommy Nov 12, 2024
262ff89
`Blazor.SimpleMultiThreadedTests`: has issues with running after build.
ilonatommy Nov 12, 2024
ffab6a3
Update README.
ilonatommy Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#nullable enable

// ToDo: should be common with Wasm.Build.Tests, copied here after Wasm.Build.Tests refactoring
namespace Wasm.Build.Tests
{
public class SharedBuildPerTestClassFixture : IDisposable
Expand Down
52 changes: 24 additions & 28 deletions src/mono/wasm/Wasm.Build.Tests/Blazor/AppsettingsTests.cs
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Xunit;
Expand All @@ -21,39 +22,34 @@ public AppsettingsTests(ITestOutputHelper output, SharedBuildPerTestClassFixture
[Fact]
public async Task FileInVfs()
{
string id = $"blazor_{GetRandomId()}";
string projectFile = CreateWasmTemplateProject(id, "blazorwasm");

string projectDirectory = Path.GetDirectoryName(projectFile)!;

File.WriteAllText(Path.Combine(projectDirectory, "wwwroot", "appsettings.json"), $"{{ \"Id\": \"{id}\" }}");

string programPath = Path.Combine(projectDirectory, "Program.cs");
string programContent = File.ReadAllText(programPath);
programContent = programContent.Replace("var builder",
"""
System.Console.WriteLine($"appSettings Exists '{File.Exists("/appsettings.json")}'");
System.Console.WriteLine($"appSettings Content '{File.ReadAllText("/appsettings.json")}'");
var builder
""");
File.WriteAllText(programPath, programContent);

BlazorBuild(new BlazorBuildOptions(id, "debug", NativeFilesType.FromRuntimePack));
string config = "debug";
ProjectInfo info = CreateWasmTemplateProject(Template.BlazorWasm, config, aot: false, "blazor");
UpdateHomePage();
string projectDirectory = Path.GetDirectoryName(info.ProjectFilePath)!;
File.WriteAllText(Path.Combine(projectDirectory, "wwwroot", "appsettings.json"), $"{{ \"Id\": \"{info.ProjectName}\" }}");
UpdateFile("Program.cs", new Dictionary<string, string>
{
{
"var builder",
"""
System.Console.WriteLine($"appSettings Exists '{File.Exists("/appsettings.json")}'");
System.Console.WriteLine($"appSettings Content '{File.ReadAllText("/appsettings.json")}'");
var builder
"""
}
});

(string _, string buildOutput) = BlazorBuild(info);
bool existsChecked = false;
bool contentChecked = false;

await BlazorRunForBuildWithDotnetRun(new BlazorRunOptions()
{
Config = "debug",
OnConsoleMessage = (_, msg) =>
{
if (msg.Text.Contains("appSettings Exists 'True'"))
await RunForBuildWithDotnetRun(new(
info.Configuration,
OnConsoleMessage: (_, msg) => {
if (msg.Contains("appSettings Exists 'True'"))
existsChecked = true;
else if (msg.Text.Contains($"appSettings Content '{{ \"Id\": \"{id}\" }}'"))
else if (msg.Contains($"appSettings Content '{{ \"Id\": \"{info.ProjectName}\" }}'"))
contentChecked = true;
}
});
}));

Assert.True(existsChecked, "File '/appsettings.json' wasn't found");
Assert.True(contentChecked, "Content of '/appsettings.json' is not matched");
Expand Down
25 changes: 0 additions & 25 deletions src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorBuildOptions.cs

This file was deleted.

This file was deleted.

Loading