Skip to content

Commit f2a5fbf

Browse files
ilonatommyradical
andauthored
[browser] Added an optional HybridGlobalization run of libraries (#95324)
* Interpreted, optional lane for HG. * Move hg job to `runtime-wasm-libtests` * Try fixing skipping HG. * Temporarily remove, to be added in a follow up PR. * Added AOT version. * Using build arg instead of helix arg. * Start triggering WBT on wasi changes * Revert, wrong PR * Avoid `$(HybridGlobalization) has no effect when $(InvariantGlobalization) is set to true.` * Block tests using not supported operations. * Hybrid Globalization cannot be treated as ICU Globalization + more GetHashCode to be blocked. * Fact, not Theory. * Revert: tests with remaining ICU data in hybrid should behave like icu for IDN mapping. * Block AOT lane and tests hitting PSNE * Blocked. * Block failing tests + fix incorrect spaces. * Blocked non-working Node platform discovery. * Revert. * We shouldn't be using net8 machine anymore. * Better logging + corrected some expected results. * Fix build * Better failure logging. * Logging improvement. * Responses to bangla and bengali are different. * Fix for node 17.3.1. * Update src/libraries/Common/tests/Tests/System/StringTests.cs Co-authored-by: Ankit Jain <[email protected]> --------- Co-authored-by: Ankit Jain <[email protected]>
1 parent 8ec34f3 commit f2a5fbf

File tree

76 files changed

+1956
-1804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1956
-1804
lines changed

eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
#
1818
# ************ Rolling builds: *************
19-
# - only run eat, and aot tests
19+
# - only run eat and aot tests
2020
# - rest are covered by runtime
2121
#
2222
- ${{ if eq(parameters.isRollingBuild, true) }}:
@@ -205,6 +205,39 @@ jobs:
205205
scenarios:
206206
- normal
207207

208+
# Hybrid Globalization tests
209+
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
210+
parameters:
211+
platforms:
212+
- browser_wasm
213+
- browser_wasm_win
214+
nameSuffix: _HybridGlobalization
215+
extraBuildArgs: /p:HybridGlobalization=true
216+
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
217+
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
218+
alwaysRun: true
219+
scenarios:
220+
- normal
221+
- WasmTestOnBrowser
222+
- WasmTestOnNodeJS
223+
224+
# Hybrid Globalization AOT tests - https://github.com/dotnet/runtime/issues/94212
225+
# - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
226+
# parameters:
227+
# platforms:
228+
# - browser_wasm
229+
# - browser_wasm_win
230+
# nameSuffix: _HybridGlobalization_AOT
231+
# extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /p:HybridGlobalization=true
232+
# runAOT: true
233+
# isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
234+
# isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
235+
# alwaysRun: true
236+
# scenarios:
237+
# - normal
238+
# - WasmTestOnBrowser
239+
# - WasmTestOnNodeJS
240+
208241
- ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeNonLibTests, true), ne(parameters.debuggerTestsOnly, true)) }}:
209242
# Builds only
210243
- template: /eng/pipelines/common/templates/wasm-build-only.yml

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,6 @@ jobs:
181181

182182
# Browser WebAssembly windows
183183
- ${{ if in(parameters.platform, 'browser_wasm_win', 'wasi_wasm_win') }}:
184-
- (Windows.Amd64.Server2022.Open)[email protected]/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly-net8
184+
- (Windows.Amd64.Server2022.Open)[email protected]/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly
185185

186186
${{ insert }}: ${{ parameters.jobParameters }}

src/libraries/Common/tests/Tests/System/StringTests.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,7 @@ public static void ContainsMatchDifferentSpans_StringComparison()
12851285

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

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

3219-
Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
3221+
if (!PlatformDetection.IsHybridGlobalizationOnBrowser)
3222+
Assert.Equal(0, source.IndexOf(target, StringComparison.CurrentCultureIgnoreCase));
32203223
Assert.Equal(-1, source.IndexOf(target, StringComparison.Ordinal));
32213224
Assert.Equal(-1, source.IndexOf(target, StringComparison.OrdinalIgnoreCase));
32223225

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

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

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

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

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

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

53475356
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
53485357
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnOSX))]
5358+
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
53495359
public static void Test_ToLower_Culture()
53505360
{
53515361
foreach (object[] testdata in ToLower_Culture_TestData())
@@ -5863,6 +5873,7 @@ public static IEnumerable<object[]> ToUpper_Culture_TestData()
58635873
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
58645874
[ActiveIssue("https://github.com/dotnet/runtime/issues/95338", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnOSX))]
58655875
[MemberData(nameof(ToUpper_Culture_TestData))]
5876+
[ActiveIssue("https://github.com/dotnet/runtime/issues/95503", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
58665877
public static void Test_ToUpper_Culture(string actual, string expected, CultureInfo culture)
58675878
{
58685879
Assert.Equal(expected, actual.ToUpper(culture));
@@ -5962,6 +5973,7 @@ public static IEnumerable<object[]> ToUpper_TurkishI_InvariantCulture_MemberData
59625973

59635974
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
59645975
[MemberData(nameof(ToUpper_TurkishI_InvariantCulture_MemberData))]
5976+
[ActiveIssue("https://github.com/dotnet/runtime/issues/95471", typeof(PlatformDetection), nameof(PlatformDetection.IsHybridGlobalizationOnBrowser))]
59655977
public static void ToUpper_TurkishI_InvariantCulture(string s, string expected)
59665978
{
59675979
using (new ThreadCultureChange(CultureInfo.InvariantCulture))

src/libraries/Microsoft.VisualBasic.Core/tests/CollectionsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static void Add_RelativeIndex()
7474
Assert.Equal(item1, coll[3]);
7575
}
7676

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

178-
[Fact]
178+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
179179
public static void Remove_Key()
180180
{
181181
var coll = CreateKeyedCollection(10);
@@ -185,7 +185,7 @@ public static void Remove_Key()
185185
Assert.False(coll.Contains("Key3"));
186186
}
187187

188-
[Fact]
188+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
189189
public static void Remove_InvalidKey_ThrowsArgumentException()
190190
{
191191
var coll = CreateKeyedCollection(10);
@@ -242,7 +242,7 @@ public static void Contains()
242242
Assert.False(coll.Contains(new Foo()));
243243
}
244244

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

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

294-
[Fact]
294+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
295295
public static void Item_GetByKey_InvalidIndex_ThrowsIndexOutOfRangeException()
296296
{
297297
Collection coll = CreateKeyedCollection(10);

src/libraries/Microsoft.VisualBasic.Core/tests/LateBindingTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
99
{
1010
public class LateBindingTests
1111
{
12-
[Theory]
12+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
1313
[MemberData(nameof(LateCall_TestData))]
1414
public void LateCall(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, Func<object, object> getResult, object expected)
1515
{
1616
LateBinding.LateCall(obj, objType, name, args, paramNames, copyBack);
1717
Assert.Equal(expected, getResult(obj));
1818
}
1919

20-
[Theory]
20+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
2121
[MemberData(nameof(LateGet_TestData))]
2222
public void LateGet(object obj, Type objType, string name, object[] args, string[] paramNames, bool[] copyBack, object expected)
2323
{
2424
Assert.Equal(expected, LateBinding.LateGet(obj, objType, name, args, paramNames, copyBack));
2525
}
2626

27-
[Theory]
27+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
2828
[MemberData(nameof(LateSet_TestData))]
2929
public void LateSet(object obj, Type objType, string name, object[] args, string[] paramNames, Func<object, object> getResult, object expected)
3030
{
3131
LateBinding.LateSet(obj, objType, name, args, paramNames);
3232
Assert.Equal(expected, getResult(obj));
3333
}
3434

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

84-
[Theory]
84+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
8585
[MemberData(nameof(LateIndexSetComplex_TestData))]
8686
public void LateIndexSetComplex(object obj, object[] args, string[] paramNames, bool missing, bool valueType)
8787
{

src/libraries/Microsoft.VisualBasic.Core/tests/LikeOperatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.VisualBasic.CompilerServices.Tests
99
{
1010
public class LikeOperatorTests
1111
{
12-
[Theory]
12+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
1313
[MemberData(nameof(LikeObject_TestData))]
1414
[MemberData(nameof(LikeString_TestData))]
1515
public void LikeObject(object source, object pattern, object expectedBinaryCompare, object expectedTextCompare)
@@ -18,7 +18,7 @@ public void LikeObject(object source, object pattern, object expectedBinaryCompa
1818
Assert.Equal(expectedTextCompare, LikeOperator.LikeObject(source, pattern, CompareMethod.Text));
1919
}
2020

21-
[Theory]
21+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
2222
[MemberData(nameof(LikeString_TestData))]
2323
public void LikeString(string source, string pattern, bool expectedBinaryCompare, bool expectedTextCompare)
2424
{

src/libraries/Microsoft.VisualBasic.Core/tests/ObjectTypeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public static IEnumerable<object[]> GetObjectValuePrimitive_TestData()
287287
// Add more...
288288
}
289289

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

326-
[Theory]
326+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnBrowser))]
327327
[MemberData(nameof(ObjTst_TestData))]
328328
public void ObjTst(object x, object y, bool textCompare, object expected)
329329
{

0 commit comments

Comments
 (0)