-
Notifications
You must be signed in to change notification settings - Fork 9
FieldInfo and FieldKey improvements #2516
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
Conversation
labkey-danield
left a comment
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.
The test shouldn't always quote the parent sample.
| log("Verify import tsv should successfully create derivatives from parent starting with #, as long as values are quoted"); | ||
| data = "MaterialInputs/" + EscapeUtil.fieldKeyEncodePart(PARENT_SAMPLE_TYPE) + "\n"; // fully encoded | ||
| data += "\"" + PARENT_SAMPLE_03 + "\"\n"; | ||
| data += "\"" + PARENT_SAMPLE_03 + "," + PARENT_SAMPLE_02 + "\"\n"; |
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.
You shouldn't quote the parent id all the time. Having a parent id not quoted is valid input, and this should be tested. Obviously there are exception (if the name begins with a # and it is the first character).
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 quoted these because PARENT_SAMPLE_03 does start with a #.
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.
Ok, I obviously missed that.
I'll mark the PR as approved.
| { | ||
| return nameExpressionNeedsEscaping.matcher(name).replaceAll("\\\\$1"); | ||
| } | ||
| } |
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!
| * @param fieldDefinitionMutator will be invoked by {@link #getFieldDefinition()} | ||
| * @return a new FieldInfo with the provided mutator. Any existing mutator will be replaced. | ||
| */ | ||
| @Contract(pure = true) |
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'm curious to know the use case for a Consumer of FieldDefinition
| expectedValue, actualValue); | ||
| } | ||
|
|
||
| private String tsvFromColumn(List<String> column) |
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 don't suppose this method is generic enough to belong in TestDataUtils?
labkey-chrisj
left a comment
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'm excited for these changes and all the fieldkey work you're doing here. I don't have any requests for changes, will defer to Dan
Rationale
While writing additional tests for editable grids, I made some improvements to
FieldInfoandFieldKeythat I'd like to roll out before finishing the new editable grid tests.Related Pull Requests
Changes
FieldInfocompatible with recent column identifier improvementsFieldInfo.randomto make defining fields with random names less verboseEditableGridTestto useFieldInfoSampleTypeNameExpressionTestto use random field namesTestDataGenerator.writeDatafunctionality intoTestDataUtils