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

[browser] Added an optional HybridGlobalization run of libraries #95324

Merged
merged 28 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
af7ee61
Interpreted, optional lane for HG.
ilonatommy Nov 28, 2023
a868a13
Move hg job to `runtime-wasm-libtests`
ilonatommy Nov 28, 2023
aafba02
Try fixing skipping HG.
ilonatommy Nov 29, 2023
25b0229
Temporarily remove, to be added in a follow up PR.
ilonatommy Nov 29, 2023
c77e13c
Added AOT version.
ilonatommy Nov 29, 2023
55feb98
Using build arg instead of helix arg.
ilonatommy Nov 29, 2023
b72d364
Start triggering WBT on wasi changes
ilonatommy Nov 29, 2023
daeeed7
Revert, wrong PR
ilonatommy Nov 29, 2023
3ae5f60
Avoid `$(HybridGlobalization) has no effect when $(InvariantGlobaliza…
ilonatommy Nov 29, 2023
3340faf
Block tests using not supported operations.
ilonatommy Dec 1, 2023
b80b5ba
Merge branch 'main' into fix-95282
ilonatommy Dec 1, 2023
82e6a0d
Hybrid Globalization cannot be treated as ICU Globalization + more Ge…
ilonatommy Dec 1, 2023
373a06b
Fact, not Theory.
ilonatommy Dec 1, 2023
cc07560
Revert: tests with remaining ICU data in hybrid should behave like ic…
ilonatommy Dec 4, 2023
b41b8bd
Block AOT lane and tests hitting PSNE
ilonatommy Dec 4, 2023
2be840d
Blocked.
ilonatommy Dec 4, 2023
330ff9f
Block failing tests + fix incorrect spaces.
ilonatommy Dec 5, 2023
661d046
Blocked non-working Node platform discovery.
ilonatommy Dec 5, 2023
6f87b7c
Revert.
ilonatommy Dec 5, 2023
03f086e
Merge branch 'main' into fix-95282
ilonatommy Dec 6, 2023
d179334
We shouldn't be using net8 machine anymore.
ilonatommy Dec 7, 2023
110ad6f
Better logging + corrected some expected results.
ilonatommy Dec 7, 2023
0d6f41e
Fix build
ilonatommy Dec 7, 2023
6202f5f
Better failure logging.
ilonatommy Dec 7, 2023
8cfb79d
Logging improvement.
ilonatommy Dec 7, 2023
466a50e
Responses to bangla and bengali are different.
ilonatommy Dec 7, 2023
93e09d6
Fix for node 17.3.1.
ilonatommy Dec 8, 2023
7cc6538
Update src/libraries/Common/tests/Tests/System/StringTests.cs
ilonatommy Dec 12, 2023
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
35 changes: 34 additions & 1 deletion eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

#
# ************ Rolling builds: *************
# - only run eat, and aot tests
# - only run eat and aot tests
# - rest are covered by runtime
#
- ${{ if eq(parameters.isRollingBuild, true) }}:
Expand Down Expand Up @@ -205,6 +205,39 @@ jobs:
scenarios:
- normal

# Hybrid Globalization tests
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
platforms:
- browser_wasm
- browser_wasm_win
nameSuffix: _HybridGlobalization
extraBuildArgs: /p:HybridGlobalization=true
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
alwaysRun: true
scenarios:
- normal
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
- WasmTestOnBrowser
- WasmTestOnNodeJS
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved

# Hybrid Globalization AOT tests - https://github.com/dotnet/runtime/issues/94212
# - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
# parameters:
# platforms:
# - browser_wasm
# - browser_wasm_win
# nameSuffix: _HybridGlobalization_AOT
# extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /p:HybridGlobalization=true
# runAOT: true
# isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
# isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
# alwaysRun: true
# scenarios:
# - normal
# - WasmTestOnBrowser
# - WasmTestOnNodeJS

- ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeNonLibTests, true), ne(parameters.debuggerTestsOnly, true)) }}:
# Builds only
- template: /eng/pipelines/common/templates/wasm-build-only.yml
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ jobs:

# Browser WebAssembly windows
- ${{ if in(parameters.platform, 'browser_wasm_win', 'wasi_wasm_win') }}:
- (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly-net8
- (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly

${{ insert }}: ${{ parameters.jobParameters }}
18 changes: 15 additions & 3 deletions src/libraries/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,7 @@ public static void ContainsMatchDifferentSpans_StringComparison()

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnOSX))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95471", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void ContainsNoMatch_StringComparison()
{
for (int length = 1; length < 150; length++)
Expand Down Expand Up @@ -1728,6 +1729,7 @@ public static IEnumerable<object[]> EndsWith_StringComparison_TestData()

[Theory]
[MemberData(nameof(EndsWith_StringComparison_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95473", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void EndsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected)
{
if (comparisonType == StringComparison.CurrentCulture)
Expand Down Expand Up @@ -3216,15 +3218,17 @@ which ignore the contraction collation weights (defined as 'tertiary' rules)
Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, source.IndexOf(target));
Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, source.IndexOf(target, StringComparison.CurrentCulture));

Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
if (!PlatformDetection.IsHybridGlobalizationOnBrowser)
Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(-1, source.IndexOf(target, StringComparison.Ordinal));
Assert.Equal(-1, source.IndexOf(target, StringComparison.OrdinalIgnoreCase));

ReadOnlySpan<char> span = source.AsSpan();

Assert.Equal(PlatformDetection.IsNlsGlobalization ? 0 : -1, span.IndexOf(target.AsSpan(), StringComparison.CurrentCulture));

Assert.Equal(0, span.IndexOf(target.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
if (!PlatformDetection.IsHybridGlobalizationOnBrowser)
Assert.Equal(0, span.IndexOf(target.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.Ordinal));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.OrdinalIgnoreCase));
}
Expand Down Expand Up @@ -4853,7 +4857,11 @@ public static IEnumerable<object[]> StartsWith_StringComparison_TestData()
yield return new object[] { "", "hello", StringComparison.CurrentCulture, false };

if (PlatformDetection.IsNotInvariantGlobalization && PlatformDetection.IsNotHybridGlobalizationOnOSX)
yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.CurrentCulture, true };
{
// "https://github.com/dotnet/runtime/issues/95473"
if (PlatformDetection.IsNotHybridGlobalizationOnBrowser)
yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.CurrentCulture, true };
}

// CurrentCultureIgnoreCase
yield return new object[] { "Hello", "Hel", StringComparison.CurrentCultureIgnoreCase, true };
Expand Down Expand Up @@ -4924,6 +4932,7 @@ public static IEnumerable<object[]> StartsWith_StringComparison_TestData()

[Theory]
[MemberData(nameof(StartsWith_StringComparison_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95473", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void StartsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected)
{
if (comparisonType == StringComparison.CurrentCulture)
Expand Down Expand Up @@ -5346,6 +5355,7 @@ private static IEnumerable<object[]> ToLower_Culture_TestData()

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnOSX))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void Test_ToLower_Culture()
{
foreach (object[] testdata in ToLower_Culture_TestData())
Expand Down Expand Up @@ -5863,6 +5873,7 @@ public static IEnumerable<object[]> ToUpper_Culture_TestData()
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnOSX))]
[MemberData(nameof(ToUpper_Culture_TestData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void Test_ToUpper_Culture(string actual, string expected, CultureInfo culture)
{
Assert.Equal(expected, actual.ToUpper(culture));
Expand Down Expand Up @@ -5962,6 +5973,7 @@ public static IEnumerable<object[]> ToUpper_TurkishI_InvariantCulture_MemberData

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(ToUpper_TurkishI_InvariantCulture_MemberData))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/95471", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
public static void ToUpper_TurkishI_InvariantCulture(string s, string expected)
{
using (new ThreadCultureChange(CultureInfo.InvariantCulture))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void Add_RelativeIndex()
Assert.Equal(item1, coll[3]);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Add_RelativeKey()
{
var coll = new Collection();
Expand Down Expand Up @@ -175,7 +175,7 @@ public static void RemoveAt_InvalidIndex_ThrowsArgumentOutOfRangeException()
Assert.Throws<ArgumentOutOfRangeException>("Index", () => coll.RemoveAt(-1)); // Index < 0
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Remove_Key()
{
var coll = CreateKeyedCollection(10);
Expand All @@ -185,7 +185,7 @@ public static void Remove_Key()
Assert.False(coll.Contains("Key3"));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Remove_InvalidKey_ThrowsArgumentException()
{
var coll = CreateKeyedCollection(10);
Expand Down Expand Up @@ -242,7 +242,7 @@ public static void Contains()
Assert.False(coll.Contains(new Foo()));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Contains_ByKey()
{
var coll = CreateKeyedCollection(10);
Expand Down Expand Up @@ -275,7 +275,7 @@ public static void Item_Get_InvalidIndex_ThrowsIndexOutOfRangeException()
Assert.Throws<ArgumentException>(() => coll[(object)Guid.Empty]); // Neither string nor int
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Item_GetByKey()
{
Collection coll = CreateKeyedCollection(10);
Expand All @@ -291,7 +291,7 @@ public static void Item_GetByKey()
Assert.Equal(CreateValue(11), coll[(object)'X']);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
public static void Item_GetByKey_InvalidIndex_ThrowsIndexOutOfRangeException()
{
Collection coll = CreateKeyedCollection(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
{
public class LateBindingTests
{
[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LateCall_TestData))]
public void LateCall(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, Func<object, object> getResult, object expected)
{
LateBinding.LateCall(obj, objType, name, args, paramNames, copyBack);
Assert.Equal(expected, getResult(obj));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LateGet_TestData))]
public void LateGet(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, object expected)
{
Assert.Equal(expected, LateBinding.LateGet(obj, objType, name, args, paramNames, copyBack));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LateSet_TestData))]
public void LateSet(object obj, Type objType, string name, object[] args, string[] paramNames, Func<object, object> getResult, object expected)
{
LateBinding.LateSet(obj, objType, name, args, paramNames);
Assert.Equal(expected, getResult(obj));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LateSetComplex_TestData))]
public void LateSetComplex(object obj, Type objType, string name, object[] args, string[] paramNames, bool missing, bool valueType)
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public void LateIndexSet_MissingMember(object obj, object[] args, string[] param
Assert.Throws<MissingMemberException>(() => LateBinding.LateIndexSet(obj, args, paramNames));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LateIndexSetComplex_TestData))]
public void LateIndexSetComplex(object obj, object[] args, string[] paramNames, bool missing, bool valueType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
{
public class LikeOperatorTests
{
[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LikeObject_TestData))]
[MemberData(nameof(LikeString_TestData))]
public void LikeObject(object source, object pattern, object expectedBinaryCompare, object expectedTextCompare)
Expand All @@ -18,7 +18,7 @@ public void LikeObject(object source, object pattern, object expectedBinaryCompa
Assert.Equal(expectedTextCompare, LikeOperator.LikeObject(source, pattern, CompareMethod.Text));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LikeString_TestData))]
public void LikeString(string source, string pattern, bool expectedBinaryCompare, bool expectedTextCompare)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static IEnumerable<object[]> GetObjectValuePrimitive_TestData()
// Add more...
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(LikeObj_TestData))]
public void LikeObj(object left, object right, object expectedBinaryCompare, object expectedTextCompare)
{
Expand Down Expand Up @@ -323,7 +323,7 @@ public static IEnumerable<object[]> LikeObj_NullReference_TestData()
yield return new object[] { null, "*" };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
[MemberData(nameof(ObjTst_TestData))]
public void ObjTst(object x, object y, bool textCompare, object expected)
{
Expand Down
Loading
Loading