-
Notifications
You must be signed in to change notification settings - Fork 385
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
CLDR-16393 assume cldr-archive is present for tests #3215
Conversation
0b2d39b
to
4203997
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
old tests fail though,
maybe a new logknown issue to skip the failing ones? |
I'll probably do this, but later |
bbacbcc
to
0b683a6
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
Looks like roughly the right direction, but we are running short of time; I will check in later quickly, but basically I'm done through the 6th and you through the 15th. We will need to regenerate charts and do other things that depend on platforms (which are far more timely than Subdivisiions) so I suggest again that you restore platforms with a dummy file so that we can proceed. |
There are other bugs in the unit tests besides platforms. It's not respecting the firstVersion parameter. This PR currently knows about but skips DtdType.platform in all loops, is that sufficient ?what process "needs" platforms? |
No process uses it; most of the attributeValidity is no longer used. |
Mark, I hear you; but there are other major breakages in the tests. FirstVersion is ignored in many cases. ElementInfo also ignores firstVersion. Can you comment on the unit comparator "jp-bu" I think it was ? |
Enabling the tests to work across all versions is a worthy goal. But it is
*not* a show stopper for this release. You have very little time until you
are gone, so we want to make the most of it. The separate, immediate goal
is to get GenerateSubdivisions to work.
For that, I think the only thing I think we need is to restore the platform
enum value and dtd file.
…On Wed, Aug 30, 2023 at 5:04 PM Steven R. Loomis ***@***.***> wrote:
No process uses it; most of the attributeValidity is no longer used.
I'm just leery of such a big change at a bad time.
Mark, I hear you; but there are other major breakages in the tests.
FirstVersion is ignored in many cases. ElementInfo also ignores
firstVersion.
Can you comment on the unit comparator "jp-bu" I think it was ?
—
Reply to this email directly, view it on GitHub
<#3215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMD63Z5HN4KPQFWS5JTXX7IJHANCNFSM6AAAAAA333SHUY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Can you comment on the unit comparator "jp-bu" I think it was ?
I don't have enough context to know what you mean by this. There is a unit
comparator, and there is a bu-jp unit that it will compare (below), but I
don't know what the problem is.
<convertUnit source='bu-jp' baseUnit='square-meter'
factor='tsubo_to_m2*1' systems="jpsystem"/>
…On Wed, Aug 30, 2023 at 5:41 PM Mark Davis Ⓤ ***@***.***> wrote:
Enabling the tests to work across all versions is a worthy goal. But it is
*not* a show stopper for this release. You have very little time until you
are gone, so we want to make the most of it. The separate, immediate goal
is to get GenerateSubdivisions to work.
For that, I think the only thing I think we need is to restore the
platform enum value and dtd file.
On Wed, Aug 30, 2023 at 5:04 PM Steven R. Loomis ***@***.***>
wrote:
> No process uses it; most of the attributeValidity is no longer used.
>
> I'm just leery of such a big change at a bad time.
>
> Mark, I hear you; but there are other major breakages in the tests.
> FirstVersion is ignored in many cases. ElementInfo also ignores
> firstVersion.
>
> Can you comment on the unit comparator "jp-bu" I think it was ?
>
> —
> Reply to this email directly, view it on GitHub
> <#3215 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACJLEMD63Z5HN4KPQFWS5JTXX7IJHANCNFSM6AAAAAA333SHUY>
> .
> You are receiving this because your review was requested.Message ID:
> ***@***.***>
>
|
@macchiati this is the next issue hit, in the code that GenerateSubdivisions (and others) will hit, that the |
the bu-jp units aren't present in units.xml prior to v44, that seems to be the source of the failure. I'm fine to table this for now if it's off the critical path. |
Lot's of units come into new versions, so it must be something special about that one. |
But do you agree to put this on ice for the moment? |
Yes, I agree. Since you are going to be out in car there are problems.
…On Wed, Aug 30, 2023, 20:57 Steven R. Loomis ***@***.***> wrote:
But do you agree to put this on ice for the moment?
—
Reply to this email directly, view it on GitHub
<#3215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMAPRSXIGLWHXCTRF6TXYADSJANCNFSM6AAAAAA333SHUY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
- UNLESS -DNO_CLDR_ARCHIVE=true is set
- also, reinstate the 'platform' DtdType as 'removed'
- skip ldmlICU versions that are missing - ElementAttributeInfo needs to skip XML files that are missing
1fd4f05
to
4bd5711
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
just rebasing this PR in my queue. |
this was affected by CLDR-17078 rename ldmlKeyboard.dtd to ldmlKeyboard3.dtd #3274 because we are retaining the old DTDs. It doesn't attempt to have new code test the old DTDs. |
@macchiati when this merges, you will be able to create new tests that use cldr-archive with the following snippet. No need to warn or anything as warning is already handled globally. if (!TestCLDRPaths.canUseArchiveDirectory()) {
return; // skipped
}
// ... use cldr-archive ... JUnit tests can use: assumeTrue(TestCLDRPaths.canUseArchiveDirectory()); … which will show the entire test as skipped, providing a better flag to the user. |
this issue didn't surface with current code/data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Just a few tweaks needed.
@@ -21,6 +21,7 @@ public static void main(String[] args) throws IOException { | |||
final DTD2Markdown dtd2md = new DTD2Markdown(); | |||
// System.setProperty("show_all", "true"); | |||
for (DtdType type : DtdType.values()) { | |||
if (type.getStatus() != DtdType.DtdStatus.active) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens multiple times below, so check for those also.
tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRPaths.java
Outdated
Show resolved
Hide resolved
String.format( | ||
"Could not read archive directory %s. " | ||
+ "Please: " | ||
+ "1) setup the archive, <https://cldr.unicode.org/development/creating-the-archive>, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ambiguous: does this mean #1
and (#2
or #3
), or (#1
and #2
) or #3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've changed this (see example run below).
I took out the option of changing -DARCHIVE
by instead folding that into the informative. message (-DARCHIVE=/a/b/c
) - so if /a/b/c is the wrong path the user can correct that property.
Will need to update the docs page after this of course.
I don't see the problem with the default being false. Why can't we have the
following?
1. no option
2. -DHAS_CLDR_ARCHIVE
3. -DHAS_CLDR_ARCHIVE=true
Uses the CLDR ARCHIVE
====
1. -DHAS_CLDR_ARCHIVE=false
Skips the CLDR ARCHIVE
…On Wed, Nov 29, 2023 at 2:37 PM Steven R. Loomis ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRPaths.java
<#3215 (comment)>:
> +package org.unicode.cldr.util;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.io.File;
+import org.junit.jupiter.api.Test;
+
+public class TestCLDRPaths {
+
+ @test
+ void TestCanUseArchiveDirectory() {
+ if (!canUseArchiveDirectory()) {
+ // We print this warning as part of the unit tests.
+ System.err.println(
+ "WARNING: skipping using cldr-archive. Ideally, -DNO_CLDR_ARCHIVE=false and see <https://cldr.unicode.org/development/creating-the-archive>");
Except the default is false.
How about: SKIP_CLDR_ARCHIVE=false as the default. You set it to true if
you don't want to setup CLDR-archive.
—
Reply to this email directly, view it on GitHub
<#3215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMFHYEQNSJIGTI2AQBTYG62J7AVCNFSM6AAAAAA333SHU2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONJWGMZTGOJTGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
false-by-default means that omitting any property (such as |
- use braces, spotless
- also refactor in test code
Example test run with default arguments (assumes [INFO] Running org.unicode.cldr.util.TestCLDRPaths
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.036 s - in org.unicode.cldr.util.TestCLDRPaths Example test run with [INFO] Running org.unicode.cldr.util.TestCLDRPaths
WARNING: -DHAS_CLDR_ARCHIVE=false, so skipping tests which use cldr-archive
See <https://cldr.unicode.org/development/creating-the-archive>
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.303 s - in org.unicode.cldr.util.TestCLDRPaths Example test run where cldr-archive isn't setup properly: [ERROR] org.unicode.cldr.util.TestCLDRPaths.TestCanUseArchiveDirectory Time elapsed: 0.002 s <<< ERROR!
java.lang.IllegalArgumentException: Could not read archive directory -DARCHIVE=/Users/srl295/src/cldr-archive
You must either:
1) follow instructions at <https://cldr.unicode.org/development/creating-the-archive>, or
2) skip cldr-archive tests by setting -DHAS_CLDR_ARCHIVE=false |
@@ -197,6 +197,7 @@ private static void checkBadAttributes(Relation<String, String> path2value2, Str | |||
|
|||
SupplementalDataInfo supp = SUPPLEMENTAL_DATA_INFO; | |||
for (DtdType dtdType : DtdType.values()) { | |||
if (dtdType.getStatus() != DtdType.DtdStatus.active) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an Eclipse tool that will add {...} after every if statement. If you want to fix these (and others) that way, a separate PR would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since were using spotless it would be better to set spotless to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@macchiati there are 2,000+ cases of single-line if statements in the code. I couldn't find a spotless setting to fix this, though eclipse has one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@macchiati @srl295 here is a PR with comments implying that Google Java Style does call for doing what Mark wants here, however google-java-format has a "constraint of only modifying whitespace": google/google-java-format#938
The implication seems to be that if we inserted brackets as a one-time operation using a different tool, then spotless configured for google-java-format would preserve the brackets, but exceptions could still arise in new code
CLDR-16393
This will cause tests to FAIL unless:
-DNO_CLDR_ARCHIVE=true
is set.ALLOW_MANY_COMMITS=true
cldr-archive
OR disable the check as described here.