Make zone string debug output optional in TestTranslations

Resolves: RHEL-212347
This commit is contained in:
Andrew Hughes 2026-07-16 23:15:41 +01:00
parent 70a3f79804
commit 601974e9af
2 changed files with 23 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* TestTranslations -- Ensure translations are available for new timezones
Copyright (C) 2022 Red Hat, Inc.
Copyright (C) 2026 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@ -60,15 +60,34 @@ public class TestTranslations {
public static void main(String[] args) {
boolean debug = false;
if (args.length < 1) {
System.err.println("Test must be started with the name of the locale provider.");
System.exit(1);
}
if (args.length > 1) {
debug = Boolean.parseBoolean(args[1]);
}
System.err.printf("Debugging: %s\n", debug);
testZoneStrings(debug);
String localeProvider = args[0];
testZone(localeProvider, KYIV,
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
testZone(localeProvider, CIUDAD_JUAREZ,
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
}
private static void testZoneStrings(final boolean debug) {
System.out.println("Checking sanity of full zone string set...");
boolean invalid = Arrays.stream(Locale.getAvailableLocales())
.peek(l -> System.out.println("Locale: " + l))
.peek(l -> System.out.printf(debug ? "Locale: %s\n" : "", l))
.map(l -> DateFormatSymbols.getInstance(l).getZoneStrings())
.peek(df -> System.out.printf(debug ? "Zone string size: %s\n" : "", df.length))
.flatMap(zs -> Arrays.stream(zs))
.flatMap(names -> Arrays.stream(names))
.filter(name -> Objects.isNull(name) || name.isEmpty())
@ -78,12 +97,6 @@ public class TestTranslations {
System.err.println("Zone string for a locale returned null or empty string");
System.exit(2);
}
String localeProvider = args[0];
testZone(localeProvider, KYIV,
new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
testZone(localeProvider, CIUDAD_JUAREZ,
new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
}
private static void testZone(String localeProvider, Map<Locale,String[]> exp, String[] ids) {

View File

@ -2589,6 +2589,7 @@ cjc.mainProgram(args)
- Move version information and core NVR definitions back towards the top of the file
- Specify portablerelease and rpmrelease (always 0 for portables) in the Release field
- Obsolete old RHEL releases (9.7.0-z, 10.1-z)
- Make zone string debug output optional in TestTranslations
- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. **
- Resolves: RHEL-212332
- Resolves: RHEL-212334
@ -2597,6 +2598,7 @@ cjc.mainProgram(args)
- Resolves: RHEL-212341
- Resolves: RHEL-188866
- Resolves: RHEL-212345
- Resolves: RHEL-212347
* Sat Jul 18 2026 Thomas Fitzsimmons <fitzsim@redhat.com> - 1:21.0.11.0.10-1.3
- Disable abidiff inspection in rpminspect.yaml to avoid an out-of-memory error on the CentOS test farm