[ 
https://issues.apache.org/jira/browse/ARROW-14641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17441364#comment-17441364
 ] 

Weston Pace commented on ARROW-14641:
-------------------------------------

I'd have to look closer at the test to tell for sure but the general idea is 
that `ARROW_SCOPED_TRACE` (which is just wrapping the google test concept of 
SCOPED_TRACE if you want to read up on it) should receive the minimum amount of 
information neccesary to identify the particular test case that is being run.  
That way, if a test fails, instead of seeing "Expected 3 and got 7" you will 
see something like "When parallel = true, batch_size=7 we expected 3 and got 7".

At a glance, it looks like that might be more information that is necessary to 
include in SCOPED_TRACE.  For example, if "test case 7" always has 20 rows then 
you don't need to print both test case 7 AND 20 rows (just test case 7 is 
sufficient).  It's possible some of those print statements were included for 
utility while debugging and developing the unit tests.  That kind of print 
statement can be outright removed (and doesn't need to convert to scoped trace).

> [C++][Compute] Remove print statements from unit tests
> ------------------------------------------------------
>
>                 Key: ARROW-14641
>                 URL: https://issues.apache.org/jira/browse/ARROW-14641
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>    Affects Versions: 6.0.0
>            Reporter: Ben Kietzman
>            Priority: Major
>              Labels: beginner-friendly
>             Fix For: 7.0.0
>
>
> Unit tests should avoid unconditional print statements, preferring 
> {{SCOPED_TRACE}}, {{ARROW_SCOPED_TRACE}}, or on-fail extra messages like 
> {{ASSERT_EQ(1, 2) << "extra here";}}. There are some in the hash join unit 
> tests



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to