Skip to content

Commit

Permalink
Add CUDF_TEST_PROGRAM_MAIN macro to tests lacking it (#14751)
Browse files Browse the repository at this point in the history
`JSON_PATH_TEST` and `ROW_CONVERSION_TEST` were not using the `CUDF_TEST_PROGRAM_MAIN`, and thus were not picking up the `GTEST_CUDF_RMM_MODE` env variable during nightly testing.

Authors:
  - Ed Seidl (https://github.com/etseidl)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Mike Wilson (https://github.com/hyperbolic2346)

URL: #14751
  • Loading branch information
etseidl authored Jan 22, 2024
1 parent f24f0b5 commit b1468a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cpp/tests/json/json_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@

#include <cudf_test/base_fixture.hpp>
#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/testing_main.hpp>

#include <stdexcept>

Expand Down Expand Up @@ -1016,3 +1017,5 @@ TEST_F(JsonPathTests, MissingFieldsAsNulls)
do_test("$.x[*].array", "", "null", false);
do_test("$.tup[*].a.x", "[\"5\"]", "[null,null,null,\"5\"]");
}

CUDF_TEST_PROGRAM_MAIN()
19 changes: 13 additions & 6 deletions cpp/tests/transform/row_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cudf_test/column_utilities.hpp>
#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/table_utilities.hpp>
#include <cudf_test/testing_main.hpp>

#include <cudf/column/column_view.hpp>
#include <cudf/detail/iterator.cuh>
Expand Down Expand Up @@ -164,7 +165,7 @@ TEST_F(ColumnToRowTests, ManyStrings)
return TEST_STRINGS[rand() % (sizeof(TEST_STRINGS) / sizeof(TEST_STRINGS[0]))];
});

auto const num_rows = 1000000;
auto const num_rows = 1'000'000;
auto const num_cols = 50;
std::vector<cudf::data_type> schema;

Expand Down Expand Up @@ -763,7 +764,7 @@ TEST_F(RowToColumnTests, Bigger)
std::vector<cudf::column_view> views;
std::vector<cudf::data_type> schema;

// 28 columns of 1 million rows
// 128 columns of 1 million rows
constexpr auto num_rows = 1024 * 1024;
for (int i = 0; i < 128; ++i) {
cols.push_back(cudf::test::fixed_width_column_wrapper<int32_t>(r + num_rows * i,
Expand Down Expand Up @@ -792,8 +793,8 @@ TEST_F(RowToColumnTests, Biggest)
std::vector<cudf::column_view> views;
std::vector<cudf::data_type> schema;

// 128 columns of 1 million rows
constexpr auto num_rows = 5 * 1024 * 1024;
// 128 columns of 2 million rows
constexpr auto num_rows = 2 * 1024 * 1024;
for (int i = 0; i < 128; ++i) {
cols.push_back(cudf::test::fixed_width_column_wrapper<int32_t>(r + num_rows * i,
r + num_rows * i + num_rows));
Expand Down Expand Up @@ -916,6 +917,10 @@ TEST_F(RowToColumnTests, BigStrings)

TEST_F(RowToColumnTests, ManyStrings)
{
// The sizing of this test is very sensitive to the state of the random number generator,
// i.e., depending on the order of execution, the number of times the largest string is
// selected will lead to out-of-memory exceptions. Seeding the RNG here helps prevent that.
srand(1);
char const* TEST_STRINGS[] = {
"These",
"are",
Expand Down Expand Up @@ -954,7 +959,7 @@ TEST_F(RowToColumnTests, ManyStrings)
"this string is the longest string because it is duplicated more than you can imagine "
"this string is the longest string because it is duplicated more than you can imagine "
"this string is the longest string because it is duplicated more than you can imagine "
"this string is the longest string because it is duplicated more than you can imagine "
"this string is the longest string because it is duplicated more than you can imagine ",
"a",
"good test",
"is required to produce reasonable confidence that this is working",
Expand All @@ -971,7 +976,7 @@ TEST_F(RowToColumnTests, ManyStrings)
return TEST_STRINGS[rand() % (sizeof(TEST_STRINGS) / sizeof(TEST_STRINGS[0]))];
});

auto const num_rows = 500000;
auto const num_rows = 300'000;
auto const num_cols = 50;
std::vector<cudf::data_type> schema;

Expand Down Expand Up @@ -1002,3 +1007,5 @@ TEST_F(RowToColumnTests, ManyStrings)
CUDF_TEST_EXPECT_TABLES_EQUIVALENT(in_view[0], *new_cols);
}
}

CUDF_TEST_PROGRAM_MAIN()

0 comments on commit b1468a5

Please sign in to comment.