rob05c commented on code in PR #6892:
URL: https://github.com/apache/trafficcontrol/pull/6892#discussion_r894608938


##########
lib/go-atscfg/remapdotconfig_test.go:
##########
@@ -2085,15 +2085,15 @@ func TestMakeRemapDotConfigEdgeHostRegexReplacement(t 
*testing.T) {
 
        txtLines := strings.Split(txt, "\n")
 
-       if len(txtLines) != 3 {
+       if len(txtLines) != 4 {
                t.Fatalf("expected 3 remaps from HTTP_AND_HTTPS DS, actual: 
'%v' count %v", txt, len(txtLines))

Review Comment:
   Ok, that should actually say 2 remaps, not 3. I fixed. 
   
   But I'm still having trouble understanding the confusion here.
   
   > what the problem is remains a mystery to anyone reading it. The text 
doesn't reflect what's actually expected.
   
   I'm not understanding that. The text explains exactly what the problem is, 
what's expected, and what the actual result was.
   
   So, I changed the number there to "42" to force the test to fail. If the 
test fails, it outputs:
   
   ```
   === RUN   TestMakeRemapDotConfigEdgeHostRegexReplacement
       remapdotconfig_test.go:2089: expected 3 remaps from HTTP_AND_HTTPS DS, 
actual: '# myHeaderComment
           
           map     http://server0.mypattern.cdndomain.example:12080/     
origin.example.test/ @plugin=header_rewrite.so @pparam=dscp/set_dscp_0.config 
@plugin=url_sig.so @p
   param=url_sig_mydsname.config @plugin=cachekey.so @pparam=--separator= 
@pparam=--remove-all-params=true @pparam=--remove-path=true 
@pparam=--capture-prefix-uri=/^([^?]*)
   /$1/ @plugin=regex_remap.so @pparam=regex_remap_mydsname.config 
@plugin=cache_range_requests.so  myremaptext
           map     https://server0.mypattern.cdndomain.example:12345/     
origin.example.test/ @plugin=header_rewrite.so @pparam=dscp/set_dscp_0.config 
@plugin=url_sig.so @
   pparam=url_sig_mydsname.config @plugin=cachekey.so @pparam=--separator= 
@pparam=--remove-all-params=true @pparam=--remove-path=true 
@pparam=--capture-prefix-uri=/^([^?]*
   )/$1/ @plugin=regex_remap.so @pparam=regex_remap_mydsname.config 
@plugin=cache_range_requests.so  myremaptext' count 4
   --- FAIL: TestMakeRemapDotConfigEdgeHostRegexReplacement (0.00s)
   ```
   
   It outputs the full text of the result file. There are 2 remaps there (or 
presumably not 2, if it's legitimately failing). The failure message explains 
that 2 are expected because it's a single HTTP_AND_HTTPS DS.
   
   The count is the line count, which should be obvious from the test code. I 
guess someone could potentially be confused if they miss that. I guess we could 
change that text to "line count." But that still feels like a bit of a stretch. 
What's the confusion here?
   



-- 
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]

Reply via email to