gerlowskija commented on code in PR #4721:
URL: https://github.com/apache/solr/pull/4721#discussion_r3744294346


##########
solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java:
##########
@@ -1166,6 +1137,8 @@ public void testSorting() throws Exception {
       // now switch the order:
       booster.setTopQueryResults(reader, query, false, new String[] {"a", 
"x"}, null);
       assertQ(
+          null,

Review Comment:
   In short, yes.  This is the main thing I dislike about this PR.
   
   I'm 100% happy with the default assertQ error message here.  In an ideal 
world I'd create an assertQ override for cases like this, where I need a 
non-default query endpoint but am 100% happy with the default assertQ error 
message.  But there's no great way to do that since "message" and 
"requestHandler" are both strings and the signature of the 
reqHandler-but-no-message method would by indistinguishable from the existing 
"message-but-no-reqHandler" method.
   
   I toyed a bit with a fluent-ish solution here, where the message gets 
provided by a wrapping call and could be dropped from all of our little 
assertFoo helpers. e.g.
   ```
   withMessage(
       "This is my message on failure",
       () -> assertQ(...))
   ```
   
   Another alternative: assertQ and friends already take in a SolrQueryRequest 
(typically created via `req()` calls) and SQR has a `getPath` method that could 
probably be used rather than providing the requestHandler as a separate method 
param in assertQ.  This seems like the simplest solution, except that 
`SolrQueryRequest.getPath` seems to be largely unused, and I don't have quite 
enough context to know why.  If we could go this route it'd look like:
   ```
   assertQ(
       reqWithPath("/elevate", baseParams),
       "//([@numFound='4']")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to