Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -63,7 +63,7 @@ jobs:
# extra-platforms CoreCLR (inner loop only)
- (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64
- (Fedora.43.Amd64.Open)AzureLinux.3.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-43-helix-amd64
- (openSUSE.15.6.Amd64.Open)AzureLinux.3.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.6-helix-amd64
- (openSUSE.16.0.Amd64.Open)AzureLinux.3.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-16.0-helix-amd64
- (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-amd64

- ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static partial class PlatformDetection

public static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
public static bool IsOpenSUSE => IsDistroAndVersion("opensuse");
public static bool IsOpenSUSE16 => IsDistroAndVersion("opensuse", 16) || IsDistroAndVersion("opensuse-leap", 16);
public static bool IsUbuntu => IsDistroAndVersion("ubuntu");
public static bool IsUbuntu24 => IsDistroAndVersion("ubuntu", 24);
public static bool IsUbuntu24OrHigher => IsDistroAndVersionOrHigher("ubuntu", 24);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public void Package_Supported_NTLM()

[ConditionalFact(nameof(IsNtlmUnavailable))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/111639", typeof(PlatformDetection), nameof(PlatformDetection.IsUbuntu24OrHigher))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/111639", typeof(PlatformDetection), nameof(PlatformDetection.IsOpenSUSE16))]
public void Package_Unsupported_NTLM()
{
NegotiateAuthenticationClientOptions clientOptions = new NegotiateAuthenticationClientOptions { Package = "NTLM", Credential = s_testCredentialRight, TargetName = "HTTP/foo" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using Xunit;

namespace System.Globalization.Tests
Expand Down Expand Up @@ -71,7 +73,24 @@ public enum DataType
Day = 8
}

private static int MinEra(Calendar calendar) => calendar.GetEra(calendar.MinSupportedDateTime);
// ICU have introduced a breaking change regarding the Japanese Meiji era: the start date has been updated from 1868-09-08 to 1868-10-23.
// Additional details are available in the relevant CLDR issue https://unicode-org.atlassian.net/browse/CLDR-11375 and CLDR pull request https://github.com/unicode-org/cldr/pull/4610.
// This means the hardcoded MinSupportedDateTime for JapaneseCalendar (1868-09-08) is no longer valid on ICU and results in various tests failing.
// We have fixed the issue in .NET 11 through the PR https://github.com/dotnet/runtime/pull/122480, we can consider porting the fix to earlier versions if requested by users.
// For now, we are using reflection to get the correct MinSupportedDateTime for JapaneseCalendar on ICU and use that for testing.
private static DateTime JapaneseCalendaraMinSupportedDateTime { get; } = new Func<DateTime>(() =>
{
JapaneseCalendar calendar = new JapaneseCalendar();
object[] eraInfo = (object[])calendar.GetType().GetMethod("GetEraInfo", BindingFlags.NonPublic | BindingFlags.Static)!.Invoke(null, null)!;
long minTicks = (long)eraInfo[eraInfo.Length - 1].GetType().GetField("ticks", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(eraInfo[eraInfo.Length - 1])!;
return new DateTime(minTicks);
})();

private static DateTime GetCalendarMinSupportedDateTime(Calendar calendar) =>
PlatformDetection.IsIcuGlobalization && calendar is JapaneseCalendar ? JapaneseCalendaraMinSupportedDateTime : calendar.MinSupportedDateTime;

private static int MinEra(Calendar calendar) => calendar.GetEra(GetCalendarMinSupportedDateTime(calendar));

private static int MaxEra(Calendar calendar) => calendar.GetEra(calendar.MaxSupportedDateTime);

private static int MaxCalendarYearInEra(Calendar calendar, int era)
Expand Down Expand Up @@ -132,7 +151,7 @@ private static int MinCalendarYearInEra(Calendar calendar, int era)
Assert.InRange(era, 0, eras[0]);
if (eras.Length == 1 || era == eras[eras.Length - 1] || era == 0)
{
return calendar.GetYear(calendar.MinSupportedDateTime);
return calendar.GetYear(GetCalendarMinSupportedDateTime(calendar));
}
return calendar.GetYear(calendar.ToDateTime(1, 1, 1, 0, 0, 0, 0, era));
}
Expand Down Expand Up @@ -386,7 +405,7 @@ public void ToDateTime_Invalid_ThrowsArgumentOutOfRangeException()
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(calendar.GetYear(calendar.MaxSupportedDateTime), month, day, hour, minute, second, millisecond, MaxEra(calendar) + 1));

// New date is out of range
DateTime minDateTime = calendar.MinSupportedDateTime;
DateTime minDateTime = GetCalendarMinSupportedDateTime(calendar);
int minEra = calendar.GetEra(minDateTime);
int minYear = calendar.GetYear(minDateTime);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ private static Stream GetIdnaTestTxt()
// some exception for Windows which released ICU 72.1.0.4 which using Unicode 15.1.

string fileName = null;
if (PlatformDetection.ICUVersion >= new Version(76, 0))
if (PlatformDetection.ICUVersion >= new Version(78, 0))
fileName = "IdnaTest_17.txt";
else if (PlatformDetection.ICUVersion >= new Version(76, 0))
fileName = "IdnaTest_16.txt";
else if (PlatformDetection.ICUVersion >= new Version(72, 1, 0, 4))
fileName = "IdnaTest_15_1.txt";
Expand Down Expand Up @@ -70,7 +72,9 @@ private static IEnumerable<IConformanceIdnaTest> ParseFile(Stream stream, Func<s

private static IConformanceIdnaTest GetConformanceIdnaTest(string line, int lineCount)
{
if (PlatformDetection.ICUVersion >= new Version(76, 0))
if (PlatformDetection.ICUVersion >= new Version(78, 0))
return new Unicode_17_0_IdnaTest(line, lineCount);
else if (PlatformDetection.ICUVersion >= new Version(76, 0))
return new Unicode_16_0_IdnaTest(line, lineCount);
else if (PlatformDetection.ICUVersion >= new Version(72, 1, 0, 4))
return new Unicode_15_1_IdnaTest(line, lineCount);
Expand Down
Loading
Loading