redhat-developer / s2i-dotnetcore

.NET Core OpenShift images
Apache License 2.0
113 stars 192 forks source link

Add tests for globalization #445

Open omajid opened 1 year ago

omajid commented 1 year ago

We have run into issues with timezones in the past. Globalization is another related feature in .NET.

It would be good to verify that full globalization is enabled and works correctly in our container images.

Alternatively, for any of our containers that use globalization invariant mode, we should test that that's set up correctly too. And possibly confirm that those containers don't include unnecessary globalization data (eg, icu packages).

I couldn't see any test for these. Did I miss one? If there's no test, any reason we shouldn't add some?

tmds commented 1 year ago

I agree, such a test would be useful especially because we don't link with libicu directly. Do you want to look into adding one?

tmds commented 1 year ago

Alternatively, for any of our containers that use globalization invariant mode, we should test that that's set up correctly too. And possibly confirm that those containers don't include unnecessary globalization data (eg, icu packages).

We don't have such containers.

tmds commented 1 year ago

It seems .NET crashes if you don't have libicu and haven't configured it for invariant.

Still, an explicit test would be nice.

Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode+Settings..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.Globalization.CultureInfo.get_CurrentUICulture()
   at System.TimeZoneInfo.GetUtcStandardDisplayName()
   at System.TimeZoneInfo.CreateUtcTimeZone()
   at System.TimeZoneInfo..cctor()
   at System.DateTime.get_Now()
   at Microsoft.DotNet.Cli.Program.Main(System.String[])