New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++][Python] Run Arrow Python C++ with pytest and make sure they are run by the CI #32328
Comments
Alenka Frim / @AlenkaF:
|
Antoine Pitrou / @pitrou: So I would be in favor of making GTest an (optional) dependency of PyArrow C++. |
Alenka Frim / @AlenkaF: There was also a question Raul had on this approach when we brainstormed and I wonder also: will we have to, in this case, have similar third party dependency infrastructure as we do for Arrow C++ to download third party dependencies? Or will that not be needed only for GTest? |
Antoine Pitrou / @pitrou: |
Kouhei Sutou / @kou:
In general, I don't want PyArrow C\ to have Arrow C\'s Is |
Antoine Pitrou / @pitrou: Draft example: #define ASSERT_EQ(x, y) { \
auto&& _left = (x); \
auto&& _right = (y); \
if (_left != _right) { \
return Status::Invalid("Expected equality but ", _left, " != ", _right); \
} \
}
Status TestOwnedRefMoves() {
std::vector<OwnedRef> vec;
PyObject *u, *v;
u = PyList_New(0);
v = PyList_New(0);
{
OwnedRef ref(u);
vec.push_back(std::move(ref));
ASSERT_EQ(ref.obj(), nullptr);
}
vec.emplace_back(v);
ASSERT_EQ(Py_REFCNT(u), 1);
ASSERT_EQ(Py_REFCNT(v), 1);
return Status::Ok();
} # Cython test code
def test_owned_ref_moves():
check_status(TestOwnedRefMoves()) |
Alenka Frim / @AlenkaF: I will start with implement this approach first thing and add it to the draft PR for this issue. If it works well I will continue with this work and ping once the PR is ready. |
Alenka Frim / @AlenkaF: |
Antoine Pitrou / @pitrou: |
Alenka Frim / @AlenkaF: |
Antoine Pitrou / @pitrou: |
Alenka Frim / @AlenkaF: |
Antoine Pitrou / @pitrou: |
After #13311 is merged{
}, the tests for C PyArrow should be moved to Cython and the documentation about running the tests with GTest should be removed.{} we should:try to run the tests from the pytest to make the whole process of code quality check simplified.
make sure the CI runs these PyArrow C++ test. Currently they are not being run on the CI due to all the builds having GTest not bundled, see: https://arrow.apache.org/docs/dev/developers/python.html#testing-pyarrow-c
The migration of the tests to Cython has not proved as a good option as there are couple of tests that should stay in the C++, for example
TestMoves and similar. For this reason we will find some other solution to keep using GTest and run them with pytest, if possible.
Reporter: Alenka Frim / @AlenkaF
Assignee: Alenka Frim / @AlenkaF
PRs and other links:
Note: This issue was originally created as ARROW-17016. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: