-
Notifications
You must be signed in to change notification settings - Fork 9
coverage for Issue 52739 #2589
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
coverage for Issue 52739 #2589
Conversation
labkey-jeckels
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 bug was in how we handled the SQL for an invalid pivot query. The query here looks like it's been fixed and is running successfully.
To ensure that we cover the original issue, please remove F1 from the SELECT list and ensure that you get a reasonable error message instead of a NullPointerException. It's fine to also check the corrected version of the query as you're doing here.
labkey-jeckels
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.
Thanks for the update. This looks fine. FWIW, uou could also have used the executeSql API which would be a little more efficient.
| public void testBadPivotQuery() | ||
| { | ||
| String datasetName = TestDataGenerator.randomDomainName("D2", DomainUtils.DomainKind.StudyDatasetVisit); | ||
| String textFieldName = TestDataGenerator.randomFieldName("F1", ":,;'\""); |
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.
Is there a particular reason you are excluding these :,;'\" characters?
TestDataGenerator.randomFieldName will select a valid field name for a given domain:
public static String randomFieldName(@NotNull String part, @Nullable Integer numStartChars, @Nullable Integer numEndChars, @Nullable String exclusion, @Nullable DomainUtils.DomainKind domainKind)
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 used those in an earlier test like this one, probably shouldn't here. I'll pull those out.
Rationale
This adds test coverage for Issue 52739
Related github issue https://github.com/LabKey/kanban/issues/949
Related Pull Requests
n/a
Changes
New test method in
PivotQueryTest.java