-
Notifications
You must be signed in to change notification settings - Fork 11
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
issue #593: fix regression introduced to #325 integration tests #594
Conversation
@jordanpadams @nutjob4life @tloubrieu-jpl Can we update all pds4-jarser again and then let these unit tests run. I want to see if my changes break something else. Looks good on my laptop but it does not always translate to jenkins. |
@al-niessner merged pds4-jparser and re-ran the integration tests |
@al-niessner also can you update the PR description to use the GitHub keywords to close the ticket when we merge this (e.g. fixes #593). Just one less step for us to track down the ticket and close it out |
@al-niessner looks like the tests failed with the latest pds4-jparser |
Yes, I got the email that it failed but it was another test. Thought that might be the case because that is what happened earlier in previous ticket that broke 325. Will see why it breaks and keep going until it all turns green. Thanks. Also, I know about the keywords but thought you did not want to use them for some reason. I can use them easy enough. |
my bad. thanks! |
Okay, I do not understand where the error is here (code, test, or concept). I will write it out and hopefully never post it because I figured it out along the way. The new table validation does a better job?? and this error now seems to be doing what it is supposed to do but not what it did. So what is right? I will say that it is because now reading based on a fixed length rather than delimiter and given the table is character that seems correct as well. There is an error in the table that fields overlap (#379). In the old version, got this error and only this error:
However this is back when the character table was being processed as a delimited table. Either way of processing the table ends up here: validate/src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java Line 300 in db5bcd4
In the delimited case, it breaks out of row processing immediately, does not tell the user that it did not skip rows, and moves onward with that single error. In the character case, it generates these errors:
The first error is the same, thank goodness since the code is identical. The second error is new for reasons that I cannot explain since the error is in the middle of the record (741 bytes) but maybe for the same reason as the third error and I have not discovered it yet: delimiter table and character table do not check all of the same stuff. The third error occurs back here: validate/src/main/java/gov/nasa/pds/tools/validate/rule/pds4/TableValidator.java Line 649 in db5bcd4
There is no similar check anywhere in validateTableDelimitedContent(FieldValueValidator, URL, int, boolean). While the third error seems to point to updating the validate.features file, the second error implies not so much - mostly because I cannot explain it. When I look at XML for test the overlap is clear and the two messages from character table seems correct. Just not sure why the delimited table is not showing it since it appears to be happening the the shared code. So, what should be done? The shortest and maybe near-term-correct is to update validate.features for the two new errors but what about the contradictions with delimited table processing? Ignore it? Or is time for the real fix to all use the same table checking but just have different readers (way more work with scary unknown ripples)? |
@al-niessner I say we fix the test for now, and see if other issues arise... I agree that the second error may just occur because when the first error gets caught, the reader gets all thrown off and may just throw another? either way, I think we march forward and see if we break anything. once you update the validate.features I will merge this PR. per the contradictions with delimited processing, are you saying there is no |
Yes. |
All yours to review. Seems that cleared up all of the regression tests. |
remove unnecessary import
@@ -470,6 +469,8 @@ private void validateTableCharacterContent(FieldValueValidator fieldValueValidat | |||
ArrayList<Integer> lineLengthsArray = new ArrayList<>(0); | |||
ArrayList<Long> lineNumbersArray = new ArrayList<>(0); | |||
|
|||
line = tableIsFixedLength ? this.currentTableReader.readNextFixedLine() : this.currentTableReader.readNextLine(); |
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.
It feels like the class of currentTableReader
should provide a single API readNextLine
and it itself figures out if it needs to provide a fixed line or a next line rather than relying on clients of the object to do it.
But I know, I know, I sound like a broken record. This is just the way "validate" is architected! 😝
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.
Actually, no. It is not the reader that thinks it is fixed length. It is the XML definition that thinks it should be then the test code tells the reader to do a fixed length read rather delimited based on 3 values in the XML - touch more messed up than you were giving it credit for.
Your points are correct: Yes, some XML adapter should be asked if it is fixed length. Or, yes, the reader should be more complete and use the XML to do the necessary read (jparser). Yes, nothing will change because "do not fix it if it is not broken".
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.
@nutjob4life @al-niessner if you have a proposal for an architectural improvement to the software, feel free to create a ticket for it, and we can see if it becomes a higher priority in the future. I am all good with "do not fix it if it is not broken", until the technical debt becomes too high for us to manage. @al-niessner let me know when you think we have hit that tipping point.
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.
LGTM 👍
🗒️ Summary
Many part fix. In this repository, change the table validator to push character tables to the correct test. However, it requires the changes waiting in NASA-PDS/pds4-jparser#86.
⚙️ Test Data and/or Report
Test github325 is enabled and should pass as well as all other unit tests.
♻️ Related Issues
fixes #593