Skip to content

Conversation

@ttnghia
Copy link
Contributor

@ttnghia ttnghia commented Nov 24, 2025

Currently, many groupby tests call to test_single_agg() and other utility functions in groupby_test_util.* (test_sum_agg() and test_single_scan()) to execute the test. When a failure happens, GTest only issue a trace location to somewhere in test_single_agg() while there is not any information about the actual failed test. That makes debugging a bit tricky.

This PR implements some utility macros to replace the groupby test utility functions, adding more ways to support tracing back to the original failed test:

  • CUDF_TEST_SINGLE_AGG
  • CUDF_TEST_SUM_AGG
  • CUDF_TEST_SINGLE_SCAN

With this, GTest will report an additional line containing the location of the failed test. For example:

Google Test trace:
cudf/cpp/tests/groupby/groupby_test_util.cpp:75:  <--  line of failure

cudf/cpp/tests/groupby/groupby_test_util.cpp:36: Original failure location: cudf/cpp/tests/groupby/sum_tests.cpp:192

Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
@ttnghia ttnghia self-assigned this Nov 24, 2025
@ttnghia ttnghia requested a review from a team as a code owner November 24, 2025 22:51
@ttnghia ttnghia added the 3 - Ready for Review Ready for review by team label Nov 24, 2025
@ttnghia ttnghia added the tests Unit testing for project label Nov 24, 2025
@ttnghia ttnghia added this to libcudf Nov 24, 2025
@ttnghia ttnghia added libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Nov 24, 2025
Signed-off-by: Nghia Truong <[email protected]>
Comment on lines +49 to +51
#define CUDF_TEST_SINGLE_AGG(...) cudf::test::test_single_agg(__FILE__, __LINE__, __VA_ARGS__)
#define CUDF_TEST_SUM_AGG(...) cudf::test::test_sum_agg(__FILE__, __LINE__, __VA_ARGS__)
#define CUDF_TEST_SINGLE_SCAN(...) cudf::test::test_single_scan(__FILE__, __LINE__, __VA_ARGS__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main changes are only in this file. Changes in other places are just update to use this.

Signed-off-by: Nghia Truong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change tests Unit testing for project

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant